title: Dynamic row numbering in html table
body: <p>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:</p>
  
  <pre><code>1
  3
  4
  7
  9
  </code></pre>
  
  <p>and other times it might be these rows which are visible:</p>
  
  <pre><code>2
  3
  5
  8
  </code></pre>
  
  <p>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.</p>
  
  <p>What would be an efficient way to accomplish this, dynamic row numbering?</p>