简体   繁体   中英

Min-width datatable column Primefaces

I have a dataTable displayed in full screen. Columns by default seem to adapt their width to the screen width. That's ok.

But when the screen is shorter, I would like to set a min-width to a column of the datatable. In order not to hide my selectonemenu on the column header.

I have tried to set min-width css property to a column but it doesn't work. My current work-around is to use javascript to take the current width then if it is smaller than a certain number of px, I set the width to a fixed value.

Is there any clean solution?

Thanks.

Try this:

#Colums{
min-width: 1000px !important
}

I read somewhere that adding '!important' behind css makes it so that it will take that piece of code, over any other min-width of width specification.

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