No data showing when initializing DataTable with column width set.

No data showing when initializing DataTable with column width set.

nick_bestplacesnick_bestplaces Posts: 1Questions: 1Answers: 0
edited April 2018 in Free community support

The data is loaded in an HTML table in the DOM and initialized via jQuery. DataTables initializes just fine without adding parameters, but when I add parameters the data table area is blank. I checked the browser console and the necessary HTML is all there, it just isn't being displayed.

Any ideas? Thanks in advance; my code is below.

$('#select_PopulationCount').DataTable({
                "autoWidth": false,
                "columns": [
                    { "width": "20%" }
                ]
});

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    Hi @nick_bestplaces ,

    When you use columns.width like that, you're saying the table only has one column. Take a look at that link: either have nulls for the other columns, or use columnDefs to specify a single column.

    Cheers,

    Colin

This discussion has been closed.