【问题标题】:How to change width of td, when I using bootstrap to fixed header of table?当我使用引导程序固定表头时,如何更改 td 的宽度?
【发布时间】:2017-09-24 14:46:23
【问题描述】:

表格是用引导程序完成的,每 2 个 td 对应一个 th,但我想将其中一个 td 的宽度更改为 40px。试了很久(大概一天),还是不行,谁能帮帮我?

h2.html

【问题讨论】:

  • 请将 HTML 添加到您的问题中,以便我们可以看到它,而不是链接到包含它的页面!使用edit 按钮和{} 工具更新问题。
  • Hi Brian : 谢谢你的建议,这是我的第一个问题,有些表达不符合规则,请见谅,下次我会改进的。

标签: html html-table fixed column-width


【解决方案1】:

table 中删除table-layout 规则。还要删除 html 属性 width, valign, bgcolor,因为所有属性都是已弃用的属性。而不是他们使用 css。

.table td{
max-width: 40px;
background-color: #ddd;
vertical-align: top;/* Default value in Bootstrap 3 */
}

【讨论】:

  • 谢谢你的回答,你太棒了!
猜你喜欢
  • 1970-01-01
  • 2017-03-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-08-17
  • 2012-03-09
  • 1970-01-01
相关资源
最近更新 更多