|
-
September 8th, 2008, 08:40 AM
#1
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!
-
September 8th, 2008, 09:31 AM
#2
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>"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|