The following code prints a table with one row and six cells wide, but how do i print a table with six rows and one cell wide as below
<TABLE>
<TR>
<TD><a href="page1.html">page1</a></TD>
</TR>
<TR>
<TD><a href="page2.html">page2</a></TD>
</TR>
<TR>
<TD><a href="page3.html">page3</a></TD>
</TR>
<TR>
<TD><a href="page4.html">page4</a></TD>
</TR>
<TR>
<TD><a href="page5.html">page5</a></TD>
</TR>
</TABLE>
// this table prints a tble six cells wide
$links = array(
1 => '<a href="page1.html">page1</a>',
2 => '<a href="page2.html">page2</a>',
3 => '<a href="page3.html">page3</a>',
4 => '<a href="page4.html">page4</a>',
5 => '<a href="page5.html">page5</a>');
echo "<table border=\"1\" bordercolor=#FFFFFF>\n";
echo " <tr>";
foreach ($links as $value)
{
echo "<td bgcolor=\"#FFFF99\">$value</td> ";
}
echo "</tr>";
echo "</table>";
echo "<BR><BR>";
dynamic tables & links
Moderator: General Moderators
- RandomEngy
- Forum Contributor
- Posts: 173
- Joined: Wed Jun 26, 2002 3:24 pm
- Contact:
Heh, just change your
to
and get rid of
and
Code: Select all
echo "<td bgcolor="#FFFF99">$value</td> ";Code: Select all
echo "<tr><td bgcolor="#FFFF99">$value</td></tr>";Code: Select all
echo "<tr>";Code: Select all
echo "</tr>";