Great!!!

(Spit on your worm!!!!!

)
This should work with just about any number of columns, but you'll need to change some things.
Obviously, you need to change every instance of
4 to the number of columns you want. Also, you'll need to change
for ($k=
3;$k>= (($i-1)%4); --$k) {
to be one less than the number of columns you want.
If you'd like to continue refining this, we can. (Also, you'll see how I work. Make a small change, test it out, make another small change, test it out. It's tiresome, but a lot less frustrating in the long run.)
If you want to further refine it so that you can use just one script no matter how many columns you want to use, first change all instances of
4 to a variable. The changes you need to make are in red.
Code:
$in{'col'} = 4;
$i = 1;
print qq|<table align="left" border="0" cellpadding="1" cellspacing="7">|;
foreach $field (sort @selectfields) {
$sfield = &urlencode($field);
if ($i%$in{'col'} == 1) {
print qq|<tr>|;
}
print qq|
<td>
<font face="arial, helvetica" size="2" color="#000000">
<B><a href="$db_script_link_url&$&view_records=1&ID=*&$cat_name=$sfield&sb=1&so=descend" onMouseOver="status=('$field'); return true">
$field</a></B> <$smfont>(<font color="ff0000">$count{$field}</font>)</font>
</td>
|;
unless ($i%$in{'col'}) {
print qq|</tr>|;
}
++$i;
}
if (($i-1)%$in{'col'}) {
for ($k=$in{'col'}-1;$k>= (($i-1)%$in{'col'}); --$k) {
print "<td> </td>";
}
print "</tr>";
}
print qq|</table>|;
Test that out and see if it gives you the same results
JPD
http://www.jpdeni.com/dbman/