title: Adding serial number to the table
body: <p>I have this PHP code that displays data from the MySQL database. I would like to add a serial number for which I tried with the following code but it doesn't work as it's not in the loop and also it doesn't know endpoint and so I have max at 12:</p>
  <pre><code>&lt;?php foreach (range(0, 12) as $number) { echo $number; }?&gt;
  </code></pre>
  <p>Here's the main PHP code. How do I add a serial number to the <code>&lt;td&gt;</code> block:</p>
  <pre><code>&lt;tbody&gt;
          &lt;?php foreach ($items as $i =&gt; $item) : ?&gt;
              &lt;tr id=&quot;tablelist_item_&lt;?php echo $i; ?&gt;&quot; class=&quot;&lt;?php echo $fc_item_classes.' row'.($i%2 ? 1 : 0); ?&gt;&quot; &lt;?php echo $microdata_itemtype_code; ?&gt;&gt;
              
              &lt;?php if ( $buttons_exists || $show_title || count($item-&gt;css_markups) ) : ?&gt;
                &lt;td&gt;&lt;?php foreach (range(0, 12) as $number) { echo $number; }?&gt;&lt;/td&gt;
                  &lt;td class=&quot;fc_title_col&quot;&gt;
                  
                  &lt;?php if ($show_title) : ?&gt;
                      &lt;!-- BOF item title --&gt;
                      &lt;span class=&quot;fc_item_title&quot; itemprop=&quot;name&quot;&gt;
                      &lt;?php if ($link_titles) : ?&gt;
                          &lt;a href=&quot;&lt;?php echo JRoute::_(FlexicontentHelperRoute::getItemRoute($item-&gt;slug, $item-&gt;categoryslug, 0, $item)); ?&gt;&quot; itemprop=&quot;url&quot;&gt;&lt;?php echo $item-&gt;title; ?&gt;&lt;/a&gt;
                  &lt;?php else : ?&gt;
                          &lt;?php echo $item-&gt;title; ?&gt;
                      &lt;?php endif; ?&gt;
                      &lt;/span&gt;
                      &lt;!-- EOF item title --&gt;
                  &lt;?php endif; ?&gt;
                  
                  &lt;div class=&quot;fcclear fc_beforemarkups&quot;&gt;&lt;/div&gt;
                  
                  &lt;/td&gt;
              &lt;?php endif; ?&gt;
          
          
              &lt;!-- BOF item fields --&gt;
              &lt;?php foreach ($columns as $name =&gt; $label) : ?&gt;
                  &lt;td&gt;&lt;?php echo isset($item-&gt;positions['table']-&gt;{$name}-&gt;display) ? $item-&gt;positions['table']-&gt;{$name}-&gt;display : ''; ?&gt;&lt;/td&gt;
              &lt;?php endforeach; ?&gt;
              &lt;!-- EOF item fields --&gt;
                      
              &lt;/tr&gt;
      
          &lt;?php endforeach; ?&gt;
  &lt;/tbody&gt;
  </code></pre>