What to do if Datatables headers are not aligned

小云云
Release: 2017-11-29 09:32:15
Original
2304 people have browsed it

In this chapter we will teach you a solution to the misalignment of jQuery Datatables headers. We often encounter this situation when using Datatables, that is, after the size or resolution of the elements in the browser or HTML is changed, the title will be misaligned. This situation is because serverSide is used in the Datatables framework : true, // The server queries the data attributes, which will add a style="width:**px;" attribute to the Table tag, which causes the title to be misaligned when the size changes.

名称 说明 类型 是否默认 状态
Copy after login

What to do if Datatables headers are not aligned

Solution

#example{ width: 100% !important; }
Copy after login

If there is a horizontal scroll bar, set the Table width to a fixed value

#example{ width: ***px !important; }
Copy after login

What to do if Datatables headers are not aligned

This is the perfect solution.

The above content is the solution to the misalignment of jQuery Datatables headers. I hope it can help everyone.

Related recommendations:

Introduction to the method of freezing and locking the header in PHPExcel

Implementing the slash header in the table table in HTML5 5 ways to improve the effect

5 recommended articles about header sorting

The above is the detailed content of What to do if Datatables headers are not aligned. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!