【问题标题】:How can I make DataTable columns at least as wide as the header text?如何使 DataTable 列至少与标题文本一样宽?
【发布时间】:2011-08-26 12:59:12
【问题描述】:

我注意到在使用DataTables 时,列标题有时会自动换行,因为宽度显然只是根据表格正文中的内容计算得出的。如何配置 DataTables 以使列的宽度至少足以容纳标题文本而无需换行?

【问题讨论】:

  • 你试过 white-space: nowrap;使用 css?
  • @Ziga 成功了,尽管我仍然更喜欢直接配置 DataTables。不过,您可能希望将此作为答案提交。

标签: javascript jquery datatables


【解决方案1】:

你试过white-space: nowrap;使用css吗?

【讨论】:

  • 我在 td 或 th css 中尝试过空白...但没有影响... :(
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-09-20
  • 1970-01-01
  • 2020-08-25
  • 2020-12-17
  • 1970-01-01
  • 2011-06-01
  • 2017-10-02
相关资源
最近更新 更多