Item12609: TablePlugin does not generate unique CSS row number
Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release:
Extract from the docs:
CSS written by TablePlugin
.foswikiTableCol + column number |
Unique column identifier, for instance: foswikiTableCol0 |
.foswikiTableRow + type + row number |
Unique row identifier, for instance: foswikiTableRowdataBg0 |
The columns are indeed number 0, 1, 2, 3 ...
The rows are actually numbered 0, 1, 0, 1, 0, 1 ...
At the very least, the docs and code do not agree. I suspect fixing docs is the immediate option as quite a bit of time has lapsed and backwards compatibility comes into play.
Is generating a css class with a unique row-id actually useful? Certainly nobody has complained for years about this issue suggesting nobody has required this feature.
I now have a need to control the style of different rows which is why I came across this, but I am not sure that controllong css is the best approach, what are the alternative approaches?
--
JulianLevens - 22 Oct 2013
The 0/1 row numbering is used I suspect to change the background color for alternating rows. Changing this to actually be an incrementing row number would need to be thought through how to handle the even/odd highlighting.
--
GeorgeClark - 29 May 2014
Both classes for enumerating rows and cols are not required anymore nowadays as all browsers support
nth-child.
Actually those classes should be removed all together as it inflates the page size for large tables in a non-trivial way.
--
MichaelDaum - 23 Oct 2019