Solution to jQuery Datatables header misalignment

小云云
Release: 2017-12-07 15:57:12
Original
2246 people have browsed it

We often encounter this situation when using Datatables. After the browser or elements in HTML change the size or resolution, the title will be misaligned. This situation is because the Datatables framework uses serverSide: true,//The server queries the data attributes, which will add a style="width:**px;" attribute to the Table tag, which causes the title to change when the size is changed. uneven phenomenon. In this article, we mainly share with you the solution to the misalignment of jQuery Datatables headers. We hope it can help you.


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


##Solution



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


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


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


Call it a day, this is the perfect solution! !

Related recommendations:

Introduction to jquery plug-in datatables attributes and detailed explanations of creating paging and sorting examples

## What are #jQuery datatables? How to use datatables?

jquery+php implements the method of exporting datatables plug-in data to excel, jquerydatatables_PHP tutorial

The above is the detailed content of Solution to jQuery Datatables header misalignment. 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!