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>"; // or "<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.
Added: to get around this you could, instead, create a string and check what occurs at the end of this string - and amend it accordingly.