PHP MySQL数据按三行三列排列

PHP MySQL数据按三行三列排列,php,mysql,Php,Mysql,我想将php mysql数据排列成三行三列,类似于4f.lt(web) 线性布局是由标记引起的。在$server['s']['name']之后有一个,在Players后面有一行,在末尾有一个孤立的。首先,你的标记有点不整洁,我很想使用一个div和一个float-left类,如 <div class="box">output goes in here</div> 上面的border属性只是为了查看输出中发生了什么。一旦您对页面的外观和感觉满意,就可以删除它 好了,现在完成

我想将php mysql数据排列成三行三列,类似于4f.lt(web)


线性布局是由
标记引起的。在
$server['s']['name']
之后有一个,在
Players
后面有一行,在末尾有一个孤立的
。首先,你的标记有点不整洁,我很想使用一个div和一个float-left类,如

<div class="box">output goes in here</div>
上面的border属性只是为了查看输出中发生了什么。一旦您对页面的外观和感觉满意,就可以删除它

好了,现在完成了,只需将您想要的输出添加到每个div

<div class="box">first box content</div>
<div class="box">second box content</div>
<div class="box">third box content</div>
第一框内容
第二框内容
第三盒内容
最后,您使用了上面的绿色字体,尝试将所有样式保存在一个单独的css文件中,以保持整洁


我希望这能有所帮助。

我不理解所需的输出。
.box {
  width: 200px; /* or any dimension you like */
  height: auto;
  float: left;
  border: 1px solid green;
}
<div class="box">first box content</div>
<div class="box">second box content</div>
<div class="box">third box content</div>