$('#some-table').DataTable({
"language": {
"url": "{{ asset('/js/plugins/lang.json') }}"
},
"ordering": false,
"scrollX": true,
"scrollCollapse": false,
"searching": false,
"processing": true,
"serverSide": true,
"scrollY": 400,
"ajax": {
"url": "/ajax/url",
"type": "POST",
"data": function ( d ) {
d.some_parametr = '123';
}
},
"columns": [
{data: 'some_category', name: 'table.some_category'},
{data: 'day.1', name: 'table.day'},
{data: 'day.2', name: 'table.day'},
{data: 'day.3', name: 'table.day'},
{data: 'day.4', name: 'table.day'},
...
{data: 'day.30', name: 'table.day'},
{data: 'day.31', name: 'table.day'},
],
"initComplete": function (settings, json) {
var api = this.api();
if ( json.extra ) {
var stat_day;
for (var i = 1; i < 32; i++) {
stat_day = json.extra.stat.day[i];
$(".dataTables_scrollFootInner table tfoot tr").append($('')
.html(stat_day)
);
}
}
// Sync TFOOT scrolling with TBODY
$('.dataTables_scrollFoot').on('scroll', function () {
$('.dataTables_scrollBody').scrollLeft($(this).scrollLeft());
});
}
When the page is loaded columns borders are not the same: After you change the browser window size - all the columns aligned:
How to make so that when the page is loaded, the columns of the tables were aligned?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)