Hi All,
I need to ouptut an ordered list into a simple table something like this:
<table>
<tr>
<td><ul><li>data</li></ul></td>
<td><ul><li>...more of the same data</li></ul></td>
</tr>
</table>
The code I currently use (which works well) creates a nice two column table. But, the format does not accomodate a series of ordered lists which can vary in depth from one line to twenty lines. So, if a single item is in the same table row next to a cell which now contains several lines, an unwanted area of whitespace spearates the single line from the next line.
So how do I adapt this to fill all the available data rows into two table cells rather than create a new table row for each data row?
$columns =2;
$rows = ceil($num_rows / $columns);
$data[] = "$heading_1" ;
$data2[] = "$heading_2" ;
}
#this creates the columns
echo "<table border=\"1\">\n";
for($i = 0; $i < $rows; $i++) {
echo "<tr>\n";
for($j = 0; $j <$columns; $j++) {
if(isset($data[$i + ($j * $rows)])) {
echo "<td width=\"350\" valign=\"top\">\n" . $data[$i + ($j * $rows)] . "\n";
echo "<ul>\n" . $data2[$i + ($j * $rows)] . "</ul></td>\n";
}
}
echo"</tr>\n";
} #end else
echo " </table>\n ";
Any help would be appreciated.
Thanks in advance,
Marc