I think this is a php problem although it may just be a HTML problem. I have a php loop that outputs data into a HTML table. I want the tables that are being repeated to the screen to sit by the right side of the last table produced so they sit by the side of eachother and not below each other.
<body>
<table border=”1″ width=””>
<tr><td>System Name: </td></tr>
<tr><td>System Uptime: </td></tr>
<tr><td>Current Tcp connections: </td></tr>
<tr><td>Port 0: </td></tr>
<tr><td>Status: </td></tr>
<tr><td>Port 1: </td></tr>
<tr><td>Status: </td></tr>
</table>
<?php
// Loop
for($i=1;$i<=$maxhost;$i++)
{
// Request system name value
$sysname=snmpget($host[$i], $community, $requestval[1]);
// Request system uptime and format for output
$sysup=snmpget($host[$i], $community, $requestval[2]);
$sysupre=eregi_replace(“([0-9]{3})”,””,$sysup);
$sysupre2=eregi_replace(“Timeticks:”,””,$sysupre);
$sysupre3=eregi_replace(“[()]”,””,$sysupre2);
// Request tcp connections and format for output
$tcpcon=snmpget($host[$i], $community, $requestval[3]);
$tcpconre=eregi_replace(“Gauge32:”,””,$tcpcon);
// Request Interface status
$ifdsc0=snmpget($host[$i], $community, $requestval[4]);
$ifstat0=snmpget($host[$i], $community, $requestval[5]);
$ifdsc1=snmpget($host[$i], $community, $requestval[6]);
$ifstat1=snmpget($host[$i], $community, $requestval[7]);
// Output to page
?>
<?php
//everytime the loop goes round i need the new table to appear
//by the side of the last table produced.
echo “<table width=”10%” border=”0″>”;
echo “<tr><td>”.$sysname.”</td></tr>”;
echo “<tr><td>”.$sysupre3.”</td></tr>”;
echo “<tr><td>”.$tcpconre.”</td></tr>”;
echo “<tr><td>”.$ifdsc0.”</td></tr>”;
echo “<tr><td>”.$ifstat0.”</td></tr>”;
echo “<tr><td>”.$ifdsc1.”</td></tr>”;
echo “<tr><td>”.$ifstat1.”</td></tr>”;
echo “</table>”;
}
?>