Essentially I'd like them to be alphabetical from top to bottom and left to right but I want it split up half way so each side has the same number of entires (there could be an extra, of course).() apple () pear () orange () berry
To make it harder (not necessary), I'd like to have to option to break it into 3 sections if my number of items is greater than a certain number, say: 0-50 will have two columns, 50+ will have 3 columns.
print qq~ <form action="" method="post"> <table width="400" border="1" cellspacing="0" cellpadding="1"> <tr> <td colspan="2"><div align="center">Select search engines you wish + to submit to </div></td> </tr> <tr> ~; # break up data into 2 or three columns here #<td width="195"> </td> #<td width="195"> </td> my $data = qq(SELECT id, name FROM engine WHERE status="1"); my $sth = $dbh->prepare($data); $sth->prepare() or die $dbh->errstr; my ($id, $name); $sth->bind_columns(\$id, \$name); #i while($sth->fetch) { print qq(<input type="checkbox" name="choice" value="$id" /> - +$name); } print qq~ </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><input type="submit" name="Submit" value="Page3" / +></td> </tr> </table> ~;
In reply to how to split html printout into two table cells by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |