[英]datatable white-space:nowrap for one specific column
I have a bootstrap datatable with alot of data.我有一个包含大量数据的引导数据表。 One row in particular (Product) will always have a large amount of data.
特别是一行(产品)总是会有大量的数据。 Currently the row expands downwards and takes up alot of space
目前该行向下扩展并占用大量空间
I am trying to get the Product column to expand to the right instead of down, so that the product column title expands to fit the width of the data.我试图让产品列向右扩展而不是向下扩展,以便产品列标题扩展以适应数据的宽度。 The closes I've gotten so far is by adding this css style:
到目前为止我得到的关闭是通过添加这个 css 样式:
<style> td { white-space: nowrap; } </style>
Which will do the desired column growth, but for each column这将实现所需的列增长,但对于每一列
Is there a way to have ONLY the product column get better styling to it expands to the right and grows the column width?有没有办法让产品列获得更好的样式,使其向右扩展并增加列宽? Maybe even have two lines of text instead of one for a more compact text display.
甚至可能有两行文本而不是一行,以实现更紧凑的文本显示。
https://jsfiddle.net/martinradio/yz46nLr8/61/ https://jsfiddle.net/martinradio/yz46nLr8/61/
You can use td:nth-child(9)
.您可以使用
td:nth-child(9)
。
td:nth-child(9){
white-space: nowrap;
}
See the JSFiddle: https://jsfiddle.net/ju4d73po/请参阅 JSFiddle: https://jsfiddle.net/ju4d73po/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.