sWidth has no effect in IE8 & Chrome with long text

sWidth has no effect in IE8 & Chrome with long text

sronsieksronsiek Posts: 52Questions: 11Answers: 0
edited November 2011 in Bug reports
Hi

I have a 2 col table, the first has limited data length, the second col contains longer texts (2-3 lines without CR/LF). I'd like to either set nowrap on the first col, or, preferably, allow it enough space with sWidth set to, say 30%. This works fine in FF7.0.1, but has no effect in IE8 or Chrome. DataTables Ver is 1.8.2 (same issue in 1.8,.1). Use of aoColumns or aoColumnDefs makes no difference.

[code]
var options = {
// "sScrollY": "450px",
"sScrollY": "23px",
// "sScrollX": "",
"bInfo": true, // show display summary
"bAutowidth": false,
"bPaginate": false,
"bProcessing": true, // Show 'processing' box during load
"sAjaxSource": '/my_controller.js',
"sDom": 'iflrtp<"clear">', // i=info, f=filter l=length r= t=table p=pagination
"aoColumnDefs": [
{ "sWidth": "30%", "aTargets": [ 0 ] }
],
// "aoColumns": [ { "sWidth": "650px" }, null ],

// Get the table data
j.getJSON( sSource, aoData, function (json) {
// Fill the table with received data
fnCallback(json);
});
},
};

oTable = j('#my_data_table').dataTable( options );
[/code]

In IE8 & chrome the first col is very narrow - it looks like DT is assigning space according to longest text content ratio.
How can I override this?

Replies

  • hammersmashhammersmash Posts: 15Questions: 0Answers: 0
    I changed my columns to html and wrapped my data in divs. You can then set the width of the div and the column will follow.
This discussion has been closed.