datatable jquery – table header width not aligned with body width

CAUSE Most likely your table is hidden initially which prevents jQuery DataTables from calculating column widths. SOLUTION If table is in the collapsible element, you need to adjust headers when collapsible element becomes visible. For example, for Bootstrap Collapse plugin: $(‘#myCollapsible’).on(‘shown.bs.collapse’, function () { $($.fn.dataTable.tables(true)).DataTable() .columns.adjust(); }); If table is in the tab, you need … Read more

How to manually update datatables table with new JSON data

SOLUTION: (Notice: this solution is for datatables version 1.10.4 (at the moment) not legacy version). CLARIFICATION Per the API documentation (1.10.15), the API can be accessed three ways: The modern definition of DataTables (upper camel case): var datatable = $( selector ).DataTable(); The legacy definition of DataTables (lower camel case): var datatable = $( selector … Read more

TypeError: $(…).DataTable is not a function

CAUSE There could be multiple reasons for this error. jQuery DataTables library is missing. jQuery library is loaded after jQuery DataTables. Multiple versions of jQuery library is loaded. SOLUTION Include only one version of jQuery library version 1.7 or newer before jQuery DataTables. For example: <script src=”https://stackoverflow.com/questions/31227844/js/jquery.min.js” type=”text/javascript”></script> <script src=”js/jquery.dataTables.min.js” type=”text/javascript”></script> See jQuery DataTables: Common … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)