Read the statement by Michael Teeuw here.
organization of the text next to the icon.
-
I will try to play with this. But already mine gave a north !!!
I will try to create the lines. About aligning if standing next to the icons already helps. Now creating html is simpler. I will try to understand. Anything I report.
-
Wait! I think that’s not what @iorifly wants, right?
If I understand this correct (and it is difficult to understand ;) ) the text in the middle should be aligned left?
If I place the module on the right side, the text is far from the icons.
-
I will send another photo. with the module positioned to the left of the screen.
-
@doubleT yes, you are correct… sorry, I misunderstood , I thought he wanted the icons on the right end of the line
-
I actually want it that way. See how the text is perfectly aligned to the icon.
-
I also wanted to put lines
Like the ones I set as an example. I actually want white line like the one under “Home assistant”
https://imgur.com/sx9Muq2 -
Ok, I understand. I’m looking at the code and I think it’s not written very good. There are cells named “align-left” and “align-right” – stupid in this case as there’s no CSS for it and the cells are taking their alignment from the module position, it seems.
Are you familiar with the dev mode? Can you check the html structure of the table and see if the cells and table rows that you try to change have any class names?
I’m trying to figure this out and then I’d suggest some entries in the custom.css file.
-
text alignment, you will have to change the code. the author did not provide element classes you could modify with css. (see the code from one of my prior posts, he just set style to ‘align-left’ or ‘align-right’ or let it default (text nodes align right by default for ltr languages)
adding a line under some entries,
you will have to modify the code to add that capability -
It can be done in css even if there are no class names. Give me a minute.
-
Thanks! I’m in no hurry. Even because it took me a long time to get here. sdetweil helped me extremely.
Thank you very much for all your support! sensational you !!!.
-
If you want to work in the code and are not afraid that an update might overwrite it, you could try to change
// Name newCell = newrow.insertCell(1); newText = document.createTextNode(name); newCell.appendChild(newText);to
// Name newCell = newrow.insertCell(1); newCell.className = "align-left"; newText = document.createTextNode(name); newCell.appendChild(newText);That seems to be what’s aligning the icon cell to the left. That css comes from MM’s main.css.
-
I will try to locate this code.
in which module file do I look for it?
-
MMM-homeassistant-sensors.js
-
@doubleT said in organization of the text next to the icon.:
newCell = newrow.insertCell(1);
newCell.className = “align-left”;
newText = document.createTextNode(name);
newCell.appendChild(newText);alignment resolved. Can I now create lines to separate groups? Or is it impossible?
-
Ok, please keep in mind that this is not the best solution (working directly in the code).
If you want to make the changes via custom.css file, try this:
(Now, since the module is called “MMM-homeassistant-sensors” I’m going to assume the element is identifiable with _“.module.MMM-homeassistant-sensors” …)
Tell each 2nd cell to align its content left:
.module.MMM-homeassistant-sensors table tr td:nth-of-type(2) { text-align: left; }Tell the cells of the 3rd and 6th line to have a bottom border line:
.module.MMM-homeassistant-sensors table tr:nth-of-type(3) td, .module.MMM-homeassistant-sensors table tr:nth-of-type(6) td { border-bottom: 1px solid white; }If the line is separated, try:
.module.MMM-homeassistant-sensors table { border-spacing: 0; }EDIT: There was an error, it’s text-align, of course. Not test-align.
-
Let me see if I got it. I need to change the custom.css file. Where is it located?
in the css folder. I only have the main.css file
-
Create a file named “custom.css” and put the code from above inside it.
-
@doubleT said in organization of the text next to the icon.:
.module.MMM-homeassistant-sensors table {
border-spacing: 0;
}nothing happened. This is the same way. He did not create the lines.
-
Yeeeeah … what about the one above that? The 2nd part. ;)
-
@iorifly take the .module prefix off, not needed
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login