简体   繁体   中英

Bootstrap datatable column width

I am new to Bootstrap and currently modifying a website.

My goal is to add the new column, it is done. But it pushed the last column to wrapped.

The picture below explains my expectation 在此处输入图片说明

Thanks

To specify the column widths, Used the code below:

$('#table_id').dataTable( {
  "columnDefs": [
    { "width": "20%", "targets": 0 }
  ]
} );

where #table_id should be replaced with your table ID

To keep View Docket , Wizard and Express not wrapping, Use any inline element like span or i or you can use display: inline; with any element and white-space: nowrap; if required.

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