Quote:
Originally Posted by AndrewGSW
Something like the following although I'm unable to test it currently.
PHP Code:
<?php
$result = mysql_query("SELECT * from patterns WHERE cattxt = 'Wreaths' ORDER BY dsptxt");
$split = 0;
echo "<table><tr>";
while($row = mysql_fetch_array($result))
{
echo "<td><a href=\"".$row['lnktxt']."\">".$row['dsptxt']."</a></td>";
if ($split++ % 2) { // or (($split++ % 2) == 1)
echo "</tr><tr>";
}
}
if ($split % 2) {
echo "</tr></table>";
} else {
echo "<td></td></tr></table>";
}
?>
In particular, I may have the last two echoes the wrong way round(?).
You might end up with a blank row, so it needs a little more work.
|
This does exactly what I want it to do....add the table width of 100% in there so it spaces the table out through the whole screen and it is perfect! The only oddity is I have 2 links at the very top showing out of alphabetical order, but it may be a problem with how they were entered in the database.