简体   繁体   中英

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:

<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/

You can use td:nth-child(9) .

td:nth-child(9){
  white-space: nowrap;
}

See the JSFiddle: https://jsfiddle.net/ju4d73po/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM