So I have a snippet that pulls info from the data base and then inserts into a table this table has unlimited rows and 3 columns would like to know if its possible to achieve the same output without using tables. <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr class="c1"> <td width="55%"><div align="left"><strong>column #1</strong></div></td> <td width="25%"><div align="left"><strong>column #2</strong></div></td> <td width="20%"><div align="left"><strong>column #3</strong></div></td> </tr> <?php $query = mysql_query("SELECT * FROM `networks`") or die(mysql_error()); $counter = 1; while ($row = mysql_fetch_array( $query )) { echo '<tr class="'; if ($counter%2 == 1) { echo "c2"; } else { echo "c1"; } echo '">'."\n"; echo '<td><a href="http://'.$row['url'].'/">'.$row['name'].'</a></td>'."\n"; echo '<td><div>'.$row['status'].'</div></td>'."\n"; echo '<td>'.$row['type'].'</td>'."\n"; echo '</tr>'."\n"; $counter++; } echo '</table>'."\n"; ?> </table> Code (markup): Thanks in advance. Hopefully this is understandable
I'm not sure of any way but raw data. Does it mess up the page with tables? There shouldn't really be anything that a table would mess up. :/
Tables are there to show tabular data. If you are calling something from a db I would assume that it is tabular data in which case a table is the correct way to display it and trying to use something else would just highlight a lack of understanding. If you wanted to use another method to lay it out you can and just use CSS to format the layout to make it appear like a table.