使用Bootstrap并且没有其他自定义脚本,是否可以将具有2列的表转换为具有1列的表用于小显示大小?
我知道如何制作,但如果只使用div
而不是table
。
转换它:
<table>
<tr>
<td>Column 1</td>
<td>Column 2</td>
</tr>
</table>
进入这个
<table>
<tr>
<td>Column 1</td>
</tr>
<tr>
<td>Column 2</td>
</tr>
</table>
答案 0 :(得分:0)
只需使用响应表:
<table class="table-responsive">
<tr>
<td>Column 1</td>
<td>Column 2</td>
</tr>
</table>
请参阅以下链接以获取更多信息: http://getbootstrap.com/css/#tables-responsive
答案 1 :(得分:0)
根据引导程序documentation,这应该有效:
<div class="table-responsive">
<table class="table"></table>
</div>