【发布时间】:2023-03-13 23:13:01
【问题描述】:
我想在一行中显示表格的内容。截至目前,我的代码在垂直列中生成它。如何修复它,以便在生成时并排显示。
或者至少超过 2 个
最多 2 列,然后为其他值的另一行,然后在 2 列之后,另一行。
请帮我显示两者。所以我可以看到哪个更好。
这是我的代码:
<table width="" cellpadding="3" cellspacing="0" border="0">
<?php
$qry="SELECT * FROM shipping";
$result= @mysql_query($qry);
while ($row=mysql_fetch_assoc($result)){
?>
<tr class="row_submit">
<td height="250px" width="300px"><center><label>
<input type="radio" name="carrier" <?php if (isset($carrier) && $carrier=="row[ship_name]") echo "checked";?> value="<?php echo $row['ship_name']; ?>">
<!--<img src="../paymentoptions/lbc.png" alt="LBC" class="picture" width="245px" style="margin:10px"/></label></td> -->
<?php echo '<img src="data:image/jpeg;base64,'.base64_encode( $row['ship_pic'] ).'" height="210px" width="245px" style="margin:10px"/>'; ?>
<td></td>
</tr>
<tr class="row_submit">
<td height="180px" width="300px"><p><?php echo $row['ship_desc']; ?><p>
<div id='price'> Additional ₱ <?php echo $row['ship_price']; ?></div></td>
<td></td>
<?php } ?>
</table>
【问题讨论】:
标签: php mysql sql loops html-table