سؤال

For some reason, after parsing the table data, the html table gets autostyled with (see style):

<table id="datatable_user" style="width: 1649px;">

The width always depends on the window size. Strange thing is that it only happens when the data comes from an external resource:

{
"bServerSide": true,
"sAjaxSource": "data.json"
}

Also, I'm using jquery.datatables.js and datatables.bootstrap.js.

هل كانت مفيدة؟

المحلول

Fixed with:

"bAutoWidth": false
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top