rashmi_k28 Posted June 24, 2008 Share Posted June 24, 2008 In the code below if length is more than 1, I have to show two tables. The second table should get the top position as $toppos1=$toppos+260; But here second table comes inside the first table for($j=0;$j<$length;$j++){ $left=1420; $height=340; $toppos1=326; $ct=count($records); echo '<div style="position:absolute; LEFT:'.$left.'px; overflow:auto; overflow-x:hidden; height:'.$height.'px; WIDTH:1250px; TOP: '.$toppos1.'px" align=center>'; if($ct!=0){ echo '<TABLE borderColor=#006699 cellSpacing=1 cellPadding=1 overflow:auto; overflow-x:hidden; width="100%" border=1> <TBODY> <TR> <TD align=middle bgcolor=#006699 width=79><font size=20 color=#ffffff><b>Node</b></font></TD> <TD align=middle bgcolor=#006699 width=92><font size=20 color=#ffffff><b>IP</b></font></TD> </TR>'; for($i=0; $i<$ct; $i++){ $data = split(":", $records[$i]); $data1=explode(".",$data[0],2); if($i%2 == 0){ $color = '#ffffff'; }else{ $color = '#C5C7C8'; } echo "<tr>"; echo "<td width=60 align=center bgcolor=$color><font size=20>$data1[0]</font></td>"; echo "<td width=140 align=center bgcolor=$color><font size=20>$data[1]</font></td></tr>"; } } $toppos1=$toppos+260; } echo ‘</table></div>’; Link to comment https://forums.phpfreaks.com/topic/111635-table/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.