Html 更改表格行高 - Bootstrap
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23752527/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Change table row height - Bootstrap
提问by ollierexx
I am having trouble changing the height of a table row, using bootstrap. The code i have so far is:
我无法使用引导程序更改表格行的高度。我到目前为止的代码是:
<table class="table table-bordered table-hover type-list2">
<tr>
<th>#</th>
<th>DSP Type</th>
<th>Email</th>
<th>Code Type</th>
<th>Dispatch Time</th>
<th>Codes</th>
</tr>
<tr>
<td>2</td>
<td>Email</td>
<td>[email protected]</td>
<td>7 Day</td>
<td>2014-05-20 15:42:59</td>
<td>6</td>
</tr>
<tr>
<td>2</td>
<td>Manual</td>
<td>[email protected]</td>
<td>12 Month</td>
<td>2014-05-20 15:42:59</td>
<td>
WXJ79-P33MM-RX7BP-QHW86-AAAAA
<br>HW382-6TPF3-RHV63-3W8QP-AAAAA
<br>FHKV2-K376Y-3Q984-36C7C-AAAAA
<br>RHXCM-KC24C-6B7T9-TBFB3-AAAAA
<br>MD8QM-VXBQW-B72Q7-CR3BM-AAAAA
<br>GXFGV-KX7TP-82H2H-DRFHM-AAAAA
<br>VQV2F-P7VKM-MBBMB-M7JYC-AAAAA
<br>KG4VD-HWGMM-6MJCT-G7PVC-AAAAA
</td>
</tr>
and:
和:
tr {
max-height: 35px !important;
height: 35px !important;
}
Here is a Fiddle with the code: http://www.bootply.com/xPgWHFFDah
这是代码的小提琴:http: //www.bootply.com/xPgWHFFDah
回答by Adel
The solution for that is to put div inside with fixed height and overflow like the following:
解决方案是将 div 放入固定高度并溢出,如下所示:
<td>
<div style="height: 50px; overflow:auto;">
WXJ79-P33MM-RX7BP-QHW86-AAAAA
<br>HW382-6TPF3-RHV63-3W8QP-AAAAA
<br>FHKV2-K376Y-3Q984-36C7C-AAAAA
<br>RHXCM-KC24C-6B7T9-TBFB3-AAAAA
<br>MD8QM-VXBQW-B72Q7-CR3BM-AAAAA
<br>GXFGV-KX7TP-82H2H-DRFHM-AAAAA
<br>VQV2F-P7VKM-MBBMB-M7JYC-AAAAA
<br>KG4VD-HWGMM-6MJCT-G7PVC-AAAAA
</div>
</td>
look at the updated one from here
从这里看更新的