Comments MEHEDI HASSAN SHUBHO started the conversationNovember 9, 2022 at 5:43pmIs there any option to resize the column according to content or sentence? 1,850Miloš repliedNovember 10, 2022 at 6:04pmHi, Mehedi Thanks for reaching out to us. It seems that you are using a Simple table from the screenshot. What you described can be achieved by using Conditional Formatting and adding a custom CSS class to a column, then we can add custom CSS to the table, in order to change the column size, such as the width of that column. But Conditional Formatting is not available for Simple Tables. It is available for all other table types. So if you wish , you can try to make a Manual table, for example; then you can make a condition, such as " if a cell contains this string, then add class_name to that column". - Here is my example with a Manual Table, if I have this table : And let's say if I want to set custom width for column "Country".I set a Conditional rule, on Column Country, if a cell contains the word "Germany", then add CSS class to it as "customWidth". And add this CSS to Table's Customize section : .wpDataTableID-2 th.customWidth { width:500px !important; } Of course, you will change table ID to your table ID. - And for this to work, we have to set "Limit table width to page width" in Display tab of the table settings.This is how my table looks after the changes : Let me know if this might work for your use-case, and if you have any questions. Thank youKind Regards, Miloš Jovanović[email protected] Rate my supportTry our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/ 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 Sign in to reply ...
Is there any option to resize the column according to content or sentence?
Hi, Mehedi
Thanks for reaching out to us.
It seems that you are using a Simple table from the screenshot.
What you described can be achieved by using Conditional Formatting and adding a custom CSS class to a column,
then we can add custom CSS to the table, in order to change the column size,
such as the width of that column.
But Conditional Formatting is not available for Simple Tables.
It is available for all other table types.
So if you wish , you can try to make a Manual table, for example;
then you can make a condition, such as " if a cell contains this string, then add class_name to that column".
-
Here is my example with a Manual Table, if I have this table :
And let's say if I want to set custom width for column "Country".
I set a Conditional rule, on Column Country, if a cell contains the word "Germany",
then add CSS class to it as "customWidth".
And add this CSS to Table's Customize section :
Of course, you will change table ID to your table ID.
-
And for this to work, we have to set "Limit table width to page width" in Display tab of the table settings.
This is how my table looks after the changes :
Let me know if this might work for your use-case, and if you have any questions. Thank you
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
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