php - Add row number to dynamic table -


how add row number or serial number dynamically generated table?? code.

echo"<table>"; for($tr=1;$tr<=$rows;$tr++){      echo "<tr>";     for($td=1;$td<=$cols;$td++){      //  echo "<td>row: ".$tr." column: ".$td."</td>";          echo "<td><input type='text' name='bhk'></td>";      }     echo "</tr>"; }  echo "</table>"; 

try this

echo"<table>";  for($tr=1;$tr<=$rows;$tr++){        echo "<tr id=".$tr.">";      for($td=1;$td<=$cols;$td++){       //  echo "<td>row: ".$tr." column: ".$td."</td>";            echo "<td><input type='text' name='bhk'></td>";        }      echo "</tr>";  }    echo "</table>";


Comments