最近,我创建了一个网页,需要在同一页面中显示桌面和移动设备之间的两种不同格式,例如:在桌面上显示表格,在移动设备上显示卡片视图。在同一页面中创建2个不同的布局/设计
目前我使用“hidden-xs”和“visible-xs”来解决问题,但我真的很想知道使用这种方法解决问题的最佳做法吗?
是否因为做2版网页而造成设计师故障?
<div class="row col-md-12 hidden-xs">
<table>
<thead>
<tr>
<th>Image</th>
<th>Product Information</th>
<th>Qty</th>
<th>Weight</th>
<th>Price</th>
</tr>
</thead>
<tbody>
... php code get data and loop to row
</tbody>
</table></div>
<div class="row col-md-12 visible-xs">
... php code get data and loop {
<div>
<div>$data->Image</div>
<div>$data->ProductInfo</div>
<div>$data->Qty</div>
<div>$data->Weight</div>
<div>$data->price</div>
</div>
}
嗯,我使用桌面标签的桌面,但在移动我不能使用表标签,因为设计不使用表标签。 是否可以使用媒体查询解决? – Wilson
@威尔逊你有没有尝试过使用响应表可能会工作.. –
它太定制我认为,那些2就像不同的事情。这只是其中一种情况,它不是关于表格,而是布局完全不同。 – Wilson