I have recently bought the WPDataTables plugin and am very happy with my choice! I have one problem which I could not solve after hours of searching through forums, etc. The titles in the headers of my table are a few words long, but the table content is rather short! But the header, being in one line, results in having a very unnecessarily-wide table! How can I avoid this?
To be able to change the width of the columns, you would have to disable the "Scrollable" option in table's settings.
Then, you can add a class to each column, for example "narrow":
Then, go to main settings of wpDataTables, and navigate to Custom JS and CSS tab, and enter this in the Custom CSS field:
table.wpDataTable .narrow {
white-space: normal !important;
width: 130px !important;
}
This will allow word wrapping for headers and limit the width of those columns where you applied the CSS class to 130px. You can adjust it to fit your needs, of course.
Hi,
I have recently bought the WPDataTables plugin and am very happy with my choice! I have one problem which I could not solve after hours of searching through forums, etc. The titles in the headers of my table are a few words long, but the table content is rather short! But the header, being in one line, results in having a very unnecessarily-wide table! How can I avoid this?
https://stuwoli.com/en/study/college/
Many thanks
Arzhang
Hello Arzhang.
Thank you for your purchase.
To be able to change the width of the columns, you would have to disable the "Scrollable" option in table's settings.
Then, you can add a class to each column, for example "narrow":
Then, go to main settings of wpDataTables, and navigate to Custom JS and CSS tab, and enter this in the Custom CSS field:
This will allow word wrapping for headers and limit the width of those columns where you applied the CSS class to 130px. You can adjust it to fit your needs, of course.
I hope this helps.
Best regards.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables