我在 mysql 表中有 35 条 statename 记录。我已将数据分为两列这是我的需求的 php 代码
<td>
<table class="statetable">
<?
//******Fetching State Name Dynamically*****//
$fetchstate = mysql_query("SELECT LocationName FROM servicedesklocationmaster group by LocationName ASC");
$half1 = floor(mysql_num_rows($fetchstate)/2);
echo $half1;
$count = 0;
// First Half State
while($count <= $half1 && $row = mysql_fetch_array($fetchstate))
{
$statename = $row['LocationName'];
$count++;
?>
<tr>
<td>
<font size="1.5">
<input type="checkbox" name="Location[]" id="Location" checked value="<?php echo $statename;?>" onClick="CheckEachAsset()"><?php echo $statename;?><br>
</font>
</td>
<?
}
//echo $count;
?>
</tr>
</table>
</td>
<td>
<table class="statetable">
<?
// Second Half State
while($row = mysql_fetch_array($fetchstate))
{
$statename = $row['LocationName'];
?>
<tr>
<td>
<font size="1.5">
<input type="checkbox" name="Location[]" id="Location"
checked value="<?php echo $statename;?>" onClick="CheckEachAsset()"><?php echo $statename;?><br>
</font>
</td>
<?
}
?>
</tr>
</table>
</td>
现在根据我的新要求,我想将其分为 4 列,任何人都可以建议我如何实现它