user11459182
user11459182

Reputation:

How to customize width of th or td in jQuery datatable according to data?

I am using jQuery data-table, initially that data-table will be blank after ajax call it will show data but some data and their heading is breaking. How to customize width of them that it should be show in a single line without break?

In HTML----

<th width="20%" align="left" valign="middle">ON US / ON UK</th> 
<th width="20%" align="left" valign="middle">Merchant Percentage Commercial</th>

In JS Code---- I put width dynamically while getting data from ajax call.

"columns" : [{
      "data" : "ON US/ ON UK",
      "width" : "20%"
      },  
          {
      "data" : "merchant Percentage commercial",
      "width" : "25%"
      }]

I wants that all heading of datatable and data should come in one line without break.

Upvotes: 0

Views: 47

Answers (1)

Related Questions