DataTables logo DataTables

via Ad Packs
sWidth has no effect in IE8 & Chrome with long text
  • 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.

         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 );
    

    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?
  • 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.
← All Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Support

Get useful and friendly help straight from the source.

In this Discussion