在 View 中我有表格:
<table class="table table-hover table-striped">
....
</table>
我想查看 View 中的下一个结果:
table_row_1 | table_row_2
table_row_3 | table_row_4
table_row_5 | table_row_6
etc.
最佳答案
这个怎么样:
table, tr, td, thead, tbody {display: block!important;}
tr {float: left!important; width: 50%!important;}
<table class="table table-hover table-striped">
<tr><td>1</td></tr>
<tr><td>2</td></tr>
<tr><td>3</td></tr>
<tr><td>4</td></tr>
</table>
我使用了!important
,因为我们很可能必须覆盖 Twitter Bootstrap(根据您的类名)。最好不要使用 !important
并复制 Bootstrap 类/声明(并使它们稍微更具体),但这只是为了简单起见并证明此解决方案有效。
关于html - 如何以两列显示 HTML 表格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48328514/