I am building an html table dynamically, meaning that sometimes there will be different rows displayed or not displayed depending on certain other conditions. Sometimes only these rows are visible:

1
3
4
7
9

and other times it might be these rows which are visible:

2
3
5
8

Basically what I am trying to say is that there could be any combination of rows. What I want to be able to do is to display the row number (or letter) for each row, consecutively. In my first example, the five rows would be numbered consecutively from 1 to 5, and in the second example the 4 rows would be numbered consecutively from 1 to 4.

What would be an efficient way to accomplish this, dynamic row numbering?

There are about 30 possible rows which are already written. I need to be able to display and not display rows, depending on the value of of other variables, but at the end of the day I want to maintain my consecutive row numbering regardless of whichever rows happen to be displayed or not.
–
DanielAttardDec 21 '11 at 3:27

are you able to use a scripting language? Or is it strictly HTML? If it's just HTML then using javascript is really your only way.
–
RobertDec 21 '11 at 3:35