【发布时间】:2021-01-22 13:16:37
【问题描述】:
我有下面的代码显示表 td 中的数据,目前我正在显示四个表 td,但是当我增加 8 或 12 之类的 no 时,它很乱。我需要每 4 td 开始一个新行。我怎样才能做到这一点?
<tr style="background-color:white;">
<?php
while ($row = mysqli_fetch_array($rs_result)) {
// Display each field of the records.
?>
<td style="vertical-align:middle;padding-top:0px;margin-top:0px;width:32px"><img styel="height:32px;width: 32px;" src="<?php echo $row["gravator"]; ?>"/></td>
<td style="vertical-align:top;margin-left:10px;text-align:left !important;">
<!--<span><img src="<?php echo $row["gravator"]; ?>"/</span>-->
<span style="">#Ad id:<?php echo $row["id"]; ?></span><br>
<span style="margin-left:2px;border-top:1px solid blue;" class="node-text"><?php echo $row["fullname"]; ?> Has Added</span> <br>
<span style="position:absolute;margin-top:-15px;margin-left:2px;width:160px;" class="node-text"><a target="_blank" href="<?php echo $row["url"]; ?>"><?php echo $row["title"]; ?></a></span> <br>
<span style="position:absolute;margin-top:-26px;font-size:smaller;color:silver;margin-left:2px;" class="node-text">On <?php echo $row["datetime"]; ?></span>
</td>
<?php
};
?> </tr>
【问题讨论】:
-
这能回答你的问题吗? Insert tr after every third loop
标签: php line-breaks