User:Timeshifter/Sandbox33

This is no longer necessary. There is now a better solution. See:
 * Template:Static row numbers


 * See also:


 * User:Timeshifter/Sandbox34''
 * 40618
 * Number sign
 * Help:Sorting.

Fixed, automatic row numbering in a sortable table

 * User:Timeshifter/vector.css - Adapted from:
 * http://www.mediawiki.org/w/index.php?title=User:Ciencia_Al_Poder/Test&oldid=588713

/* Row numbering. */ table.rownumber { counter-reset: tablerownumber; } table.rownumber td.rownumber-value:before { content: counter(tablerownumber); counter-increment: tablerownumber; }

See http://www.w3.org/TR/CSS21/generate.html#counters


 * Whenever a table with class rownumber is encountered, the counter is reset.
 * Whenever a table cell with class rownumber-value is encountered, a generated content is added displaying the counter value.

This is what I add to my CSS page
When this below is on my vector.css page the above table has static row numbers.

User:Timeshifter/vector.css

/* Row numbering. Adapted from: /* http://www.mediawiki.org/w/index.php?title=User:Ciencia_Al_Poder/Test&oldid=588713 /* See examples: http://en.wikipedia.org/wiki/User:Timeshifter/Sandbox33 */

table.rownumber { counter-reset: tablerownumber; } table.rownumber td.rownumber-value:before { content: counter(tablerownumber); counter-increment: tablerownumber; }