katalyst
03-08-2008, 02:07 AM
Hey there, need some help here.. im stuck
What I have is a for loop that goes through and outputs an ip address to a table cell, each recursion creates a new row and prints the address... so basically what im left with is a very long 1x1 table.
now im happy that my code works for generating the table, but what im wondering is, is there a way i can "wrap" the table at the bottom and create a new column when the table reaches the bottom of the screen?
basically turning it into a 1x2 table.. (or 1x3, 1x4, etc)
is this possible?
$infocount = 18;
$timeout = 2;
echo '<table width="500" border="0" align=left>';
for($i=0; $i<=$infocount; $i++){
$fp = @fsockopen ($info[$i]["address"], $info[0]["port"], $errno, $errstr, $timeout);
if ($fp) {
echo "<tr><td width=50><img src='images/up2.gif' alt='Connected'></td><td width=450><a href='http://" . $info[$i]["address"] . "'>" . $info[$i]["name"] . "</a></td></tr>";
}else{
echo "<tr><td width=50><img src='images/down2.gif' alt='Down!'></td><td width=450>" . $info[$i]["name"] . "</td></tr>";
}
}
echo '</tr></table>';
?>
hope that works... lol... can someone help me get the table to wrap itself to a new column once it starts showing scrollbars?
thanks so much in advance!!
What I have is a for loop that goes through and outputs an ip address to a table cell, each recursion creates a new row and prints the address... so basically what im left with is a very long 1x1 table.
now im happy that my code works for generating the table, but what im wondering is, is there a way i can "wrap" the table at the bottom and create a new column when the table reaches the bottom of the screen?
basically turning it into a 1x2 table.. (or 1x3, 1x4, etc)
is this possible?
$infocount = 18;
$timeout = 2;
echo '<table width="500" border="0" align=left>';
for($i=0; $i<=$infocount; $i++){
$fp = @fsockopen ($info[$i]["address"], $info[0]["port"], $errno, $errstr, $timeout);
if ($fp) {
echo "<tr><td width=50><img src='images/up2.gif' alt='Connected'></td><td width=450><a href='http://" . $info[$i]["address"] . "'>" . $info[$i]["name"] . "</a></td></tr>";
}else{
echo "<tr><td width=50><img src='images/down2.gif' alt='Down!'></td><td width=450>" . $info[$i]["name"] . "</td></tr>";
}
}
echo '</tr></table>';
?>
hope that works... lol... can someone help me get the table to wrap itself to a new column once it starts showing scrollbars?
thanks so much in advance!!