No data showing when initializing DataTable with column width set.
No data showing when initializing DataTable with column width set.
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%" }
                ]
});
                This discussion has been closed.
            
Answers
Hi @nick_bestplaces ,
When you use
columns.widthlike that, you're saying the table only has one column. Take a look at that link: either havenullsfor the other columns, or usecolumnDefsto specify a single column.Cheers,
Colin