Setting the height of a row (or cell) using css doesn't work. The content of the cell will always override any css limitation placed on the table.
In the end I used the filter wpdatatables_filter_formdata_before_save and encased my cell content with a div, and was able to set the height of the div.
//Encase the note field in a div so we can add max-height to the css if (array_key_exists('note', $formData)) { if ( substr( $formData['note'], 0, 22 ) !== '<div class="div-note">' ) { $formData['note'] = '<div class="div-note">'.$formData['note'].'</div>'; } }
but important to note that, for some certain Table skins , we would also have to additionally set the padding value to 0 , because it has some predefined padding by certain skins.
-
Just wanted to add their input on the matter as well,
Thanks for the additional reply. I'm using the material theme, which I don't believe adds any padding. I don't think the suggested css code will work either. As far as I know, you cannot set tr or td height using css if the content of that cell is greater than the css height or max-height.
Hi, do you have a way to set a max height on either a row or cell? Can't seem to find an answer online anywhere that will work.
Thanks,
Greg
Hi, Greg
Sorry for the delay
-
You can try this CSS :
You can add it to the Custom CSS, in Customize tab of the table settings in the back-end.
Let me know if that helped.
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
Setting the height of a row (or cell) using css doesn't work. The content of the cell will always override any css limitation placed on the table.
In the end I used the filter wpdatatables_filter_formdata_before_save and encased my cell content with a div, and was able to set the height of the div.
//Encase the note field in a div so we can add max-height to the css
if (array_key_exists('note', $formData)) {
if ( substr( $formData['note'], 0, 22 ) !== '<div class="div-note">' ) {
$formData['note'] = '<div class="div-note">'.$formData['note'].'</div>';
}
}
Hi, Greg
Sorry about that, i did not understand exactly what you needed at the start,
but i can see now.
Thank you so much for sharing that workaround,
i will make sure to save this and to share it with the rest of our team, it might help other users;
and we will also pass it to our developers to consider perhaps adding a customization option for the future.
Thanks again,
and please don't hesitate to reach out to us again if there is anything we can assist with.
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
Hi, Greg
I just have an additional comment from our developers.
We wish to thank you again for sharing this workaround with the hook,
and they just made a correction for the CSS i sent earlier.
It does not work since the cells have a higher importance in the CSS hierarchy in our CSS,
so if we would use this, it would work :
but important to note that, for some certain Table skins , we would also have to additionally set the padding value to 0 , because it has some predefined padding by certain skins.
-
Just wanted to add their input on the matter as well,
thanks again.
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
Thanks for the additional reply. I'm using the material theme, which I don't believe adds any padding. I don't think the suggested css code will work either. As far as I know, you cannot set tr or td height using css if the content of that cell is greater than the css height or max-height.
G
Hi, Greg
Sorry for the delayed response once again.
Thank you for this additional detail.
I will double-check about this CSS with our developers, and they will comment on it.
We will report back with their input as soon as they respond.
Thanks again.
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
Hi, Greg
We got confirmation by the devs,
they clarified that the CSS workaround was just for general use-cases,
but as you correctly pointed out - for use-case when it needs to be based on content size , a custom solution is needed at this time.
Thank you again for sharing your workaround use-case with us.
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