[英]Html Table tbody not 100%
I have a table but it is not 100% and the tbody size it is: 485x170px, 我有一张桌子,但它不是100%,其躯干尺寸为:485x170px,
can someone help me to make this tbody 100%? 有人可以帮助我使这个结成100%吗?
<thead> needs to be fixed as now.
I need have scrool and the tbody need to stay on the size of: height: calc(100vh - 513px);
我需要可可酚,而躯干需要保持在以下尺寸:
height: calc(100vh - 513px);
click to see the image 点击查看图片
jsfiddle: https://jsfiddle.net/ab1Lsn0h/2/ jsfiddle: https ://jsfiddle.net/ab1Lsn0h/2/
css: CSS:
.staff table tbody {
overflow-y: scroll;
display: block;
height: calc(100vh - 513px);
}
.staff tbody > tr {
display: table;
width: 100%;
}
html: HTML:
<div class="col-md-4">
<div class="panel panel-default staff">
<div class="panel-heading">test</div>
<div class="panel-body">
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Surname</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>name 1</td>
<td>name 2</td>
</tr>
<tr>
<td>name 1</td>
<td>name 2</td>
</tr>
<tr>
<td>name 1</td>
<td>name 2</td>
</tr>
<tr>
<td>name 1</td>
<td>name 2</td>
</tr>
<tr>
<td>name 1</td>
<td>name 2</td>
</tr>
</tbody>
</table>
<div class="clearfix"></div>
</div>
</div>
</div>
You have to remove your display: block;
您必须删除
display: block;
and display: table;
并
display: table;
. 。
You are converting tr in table, this is wrong. 您正在转换表中的tr,这是错误的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.