-
table from array
Hello,
I have an array and a variable where I count the number of records from that array. How can I build a dynamic table (not a mysql table) starting from this variable?
For sample:
if my variable has the value 5 I need it to generate a table with 5+1 rows and 4 colums
Please advice. Thank you!
-
Re: table from array
Code:
echo "<table>"
for ($i_line=0; $i_line < $var + 1; $i_line++) {
echo "<tr>"
for ($i_col=0; $i_col < $var - 1; $i_col++) {
echo "<td>"
echo "cell ".$i_line.", ".$i_col."."
echo "</td>"
}
echo "</tr>"
}
echo "</table>"