We can enable wrapping for headers, but that will not give you any control over what goes in the next line, so it would break based on column's width.
To wrap words in the header, you would need to add custom CSS in wpDataTables settings/Custom JS and CSS/Custom CSS field:
table.wpDataTable th { white-space: normal !important; }
Have you tried enabling the Limit table width option from the Display tab in the table settings? To limit the table width to the parent container width (so it wouldn’t be wider than the page) you need to enable the “Limit table width” switch in the “Display” tab on the table settings page.
Note that the “Limit table width” and “Scrollable” features exclude one another.
When you enable the Limit table width option you will get an additional option in the column settings called Column width where you can manually further adjust the width of specific columns.
I hope this helps, do let us know if you need any further assistance.
Dear Support,
Is there anyway to set all the columns to a specific width and the header column word wrapped if the length of header is too long?
Regards
GC
Hi Grace
Thank you for reaching out to us.
We can enable wrapping for headers, but that will not give you any control over what goes in the next line, so it would break based on column's width.
To wrap words in the header, you would need to add custom CSS in wpDataTables settings/Custom JS and CSS/Custom CSS field:
Have you tried enabling the Limit table width option from the Display tab in the table settings? To limit the table width to the parent container width (so it wouldn’t be wider than the page) you need to enable the “Limit table width” switch in the “Display” tab on the table settings page.
Note that the “Limit table width” and “Scrollable” features exclude one another.
When you enable the Limit table width option you will get an additional option in the column settings called Column width where you can manually further adjust the width of specific columns.
I hope this helps, do let us know if you need any further assistance.