Open BurningTreeC opened 1 week ago
The table rowCount
variable starts at 0
The first row in a table should be the header, so the first "data" row is no. 1. -- But we can not change that any more.
Ok, so if we create a table for the wiki core using <table>
tags, we should apply the "wrong" classes to the <tr>
tags, correct?
Ok, so if we create a table for the wiki core using
tags, we should apply the "wrong" classes to the
tags, correct? It depends.
- yes ... If you want to create HTML code the is the same as a wikitext-table
no ... If you intend to use CSS
nth-of-type(even)
. It seems to start with 1tbody > tr:nth-of-type(even) { background-color: red; }
I think, I would go with option two to make it "valid" HTML code.
@Jermolene -- What do you think. Should we fix the problem with the current
|core |table parser |
? So it produces valid HTML table syntaxpmario commented 1 week agoIt seem at the moment the TW table syntax also counts a table-header if there is one. CSS nth-of-type(even) only uses the rows in the TBODY element and it starts with 1.
Jermolene commented 1 week agoHi @pmario in what way does the table parser not product valid HTML table syntax? I understand that the odd and even classes are reversed, but that is not an error of HTML syntax. Is there anything else wrong with it?
pmario commented 1 week ago@Jermolene -- Sorry bad wording. There is nothing else wrong with it. Only the counter is wrong.
Jermolene commented 1 week agoThen I think that sadly backwards compatibility constrains us to leave things as they area, but it would be great to update the documentation to call attention to it.
Describe the bug
While creating a table using a filter I wanted to apply the
evenRow
andoddRow
classes. The way I did it, the first row "1" would get theoddRow
class because "1" is odd if I recall correctly. Then I compared with how TiddlyWiki parses the| this is a table cell | this is another table cell |
constructs and I've seen that the first row gets theevenRow
class.Is this a bug or is there a reason for this?
Expected behavior
I would expect the first row to have the
oddRow
class applied. I don't believe it should beevenRow
- even if we think that it has index0
- it's the 1st row.To Reproduce
No response
Screenshots
No response
TiddlyWiki Configuration
Current prerelease
Additional context
No response