简体   繁体   English

HTML表肢不是100%

[英]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,这是错误的。

如何完全填写<div id="text_translate"><p>我有一些 HTML 将 Javascript 注入 web 页面。 我注入的最终 HTML 看起来像:</p><pre> &lt;table style="border-width: 0px; margin 0px; width:100%; height: 100%; padding:0px;"&gt; &lt;tbody style="border-width: 0px; margin 0px; width:100%; height: 100%; padding:0px;"&gt;</pre><p> 出于某种奇怪的原因,当我在 Firebug 中检查 tbody 时,它的大小似乎比表格小 4px。 我如何才能填满?</p></div>100% 与在 HTML 中?<table> <tbody></tbody></table> - How do I completely fill a <table> 100% with <tbody> in HTML?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 具有 100% 宽度的 HTML 表格,在 tbody 内具有垂直滚动 - HTML table with 100% width, with vertical scroll inside tbody 如何完全填写<div id="text_translate"><p>我有一些 HTML 将 Javascript 注入 web 页面。 我注入的最终 HTML 看起来像:</p><pre> &lt;table style="border-width: 0px; margin 0px; width:100%; height: 100%; padding:0px;"&gt; &lt;tbody style="border-width: 0px; margin 0px; width:100%; height: 100%; padding:0px;"&gt;</pre><p> 出于某种奇怪的原因,当我在 Firebug 中检查 tbody 时,它的大小似乎比表格小 4px。 我如何才能填满?</p></div>100% 与在 HTML 中?<table> <tbody></tbody></table> - How do I completely fill a <table> 100% with <tbody> in HTML? HTML表格的宽度为100%,在tbody中具有垂直滚动,而没有td wdth - HTML table with 100% width, with vertical scroll inside tbody without td wdth 如何:100%高度表仅滚动tbody - How To: 100% Height Table only Scroll tbody HTML表格thead与tbody不对齐 - HTML table thead not aligning with tbody HTML正文和旋转表中的thead - HTML tbody and thead in rotated table 数组项未使用jQuery附加到HTML Table正文 - Array items are not appending to the HTML Table tbody with jQuery 如何在HTML表格中设置Tbody的宽度和高度 - How to set width and height of Tbody in HTML table 如何垂直调整HTML表格的正文大小 - How to resize the tbody of html table vertically 使用AJAX调用更改表中“正文”的HTML内容 - Change HTML content of a “tbody” in a table with AJAX call
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM