MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    Applying CSS to individual cells in a table

    Custom CSS
    3
    7
    254
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ankonaskiff17
      ankonaskiff17 last edited by

      How do you go about changing individual cells in a table? I have been messing with MMM-Gas and out of the box it was really small in comparison to other modules. This on on a standard computer monitor and not on big TV I have been poking at, off and on.

      I got the cells/font below Price and Station enlarged no problem and at first I was anticipating them to scale up but when I dug around in MMM-Gas.js they are doing something that I have not seen before.
      ajumpy.innerHTML = "Price"; & xjumpy.innerHTML = "Station";

      Screenshot 2021-08-29 213605.jpg

      S 1 Reply Last reply Reply Quote 0
      • S
        sdetweil @ankonaskiff17 last edited by

        @ankonaskiff17 that’s just setting the content of that tag

        innerText is treated as text and never analyzed.
        innerHtml says it may contain html.

        Sam

        Create a working config
        How to add modules

        ankonaskiff17 1 Reply Last reply Reply Quote 0
        • ankonaskiff17
          ankonaskiff17 @sdetweil last edited by

          @sdetweil What is “jumpy”? Is it similar to say moment.js or other similar libraries? I know I read a bunch of stuff relating to moment.js battling with the calendar module to see if I could figure out how to make the calendar module just show a date which I failed to succeed in doing.

          S cowboysdude 3 Replies Last reply Reply Quote 0
          • S
            sdetweil @ankonaskiff17 last edited by sdetweil

            @ankonaskiff17 those are just names of variables

            var xjumpy = document.createElement(“th”);
            var ajumpy = document.createElement(“th”);
            var bjumpy = document.createElement(“th”);

            no idea why he called them that name

            so xjumpy is a th
            and ajumpy is also
            and bjumpy is also

            I would have called them
            stationColumnHeader
            priceColumnHeader
            distanceColumnHeader

            i have this little function i use when doing the content via elements

                   // create document element worker
            	createEl : function (type, id, className, parent, value) {
            		var el= document.createElement(type)
            		if(id)
            			el.id = id
            		if(className)
            			el.className = className
            		if(parent)
            			parent.appendChild(el)
            		if(value) {
            			var e = document.createTextNode(value)
            			el.appendChild(e)
            		}
            
            		return el
            	},
            

            u can create and element, set its id, add a class, set its parent and add its value all in one stmt… reduces the size of the code u write, (but not the amount of code you execute)

            from my bdlist module ,using it

            	var table = this.createEl("table", "birthday-table","TABLE", wrapper, null);
            

            Sam

            Create a working config
            How to add modules

            1 Reply Last reply Reply Quote 0
            • S
              sdetweil @ankonaskiff17 last edited by

              @ankonaskiff17 said in Applying CSS to individual cells in a table:

              I could figure out how to make the calendar module just show a date which I failed to succeed in doing.

              what do you want to do there?

              Sam

              Create a working config
              How to add modules

              ankonaskiff17 1 Reply Last reply Reply Quote 0
              • cowboysdude
                cowboysdude Module Developer @ankonaskiff17 last edited by

                @ankonaskiff17 Called boredom LOL

                1 Reply Last reply Reply Quote 0
                • ankonaskiff17
                  ankonaskiff17 @sdetweil last edited by

                  @sdetweil Have it read MM/DD/YY, even on the day of event.
                  Either 6 or 7 days out from calendar event, the date swaps from MM/DD/YY to Monday at 12:00 AM. (For US Labor Day holiday, in this case)
                  hideTimegets me to it just showing Monday.

                  I thought getRelative: 0, was used to do what I want it to do, You have option of from between 0 - 48 hours with default being 6 hours it goes to relative time. It is swapping at about 6 - 7 DAYS in reality. Maybe just a coincidence but it seems like the default getRelative: 6;is 6 days, not hours, and setting it to zero has no effect.

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Enjoying MagicMirror? Please consider a donation!
                  MagicMirror created by Michael Teeuw.
                  Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                  This forum is using NodeBB as its core | Contributors
                  Contact | Privacy Policy