I have a broad question on how to customize cell contents. This includes font size, alignment, margins, paddings, text size, image size, text color, background color of each cell or row.
Unfortunately, there isn't any documentation with detailed instructions on how you can do this, but if what you're looking for isn't found in "Settings/Color and font settings", you can do it with custom CSS.
For example, you can add a Custom CSS Class to the column, which is meant to call on a class which you would define in Custom CSS field in main settings of wpDataTables.
So, if you were to name the class "color1", you should go to main settings/Custom JS and CSS/Cusom CSS, and enter this:
table.wpDataTable td.color1 {
color: red !important;
}
For table headers, you can find the column name in the column settings:
Then add the following CSS:
.wpdt-c th.column-product {
background-color: red !important;
}
My test table has columns "Name", "Product", "Date" and "Image", so my CSS would look like this:
If you want to apply this to all tables, you can paste the CSS in Custom CSS field in Custom JS and CSS tab in main settings of wpDataTables. If, however, you wish to apply this only to a certain table on front-end, you need to add it when you're creating the page, above the shortcode, in between the <style>...</style> tags, like this:
Dear support,
I have a broad question on how to customize cell contents. This includes font size, alignment, margins, paddings, text size, image size, text color, background color of each cell or row.
Is there any documentation??
Hello fangquans
Unfortunately, there isn't any documentation with detailed instructions on how you can do this, but if what you're looking for isn't found in "Settings/Color and font settings", you can do it with custom CSS.
For example, you can add a Custom CSS Class to the column, which is meant to call on a class which you would define in Custom CSS field in main settings of wpDataTables.
So, if you were to name the class "color1", you should go to main settings/Custom JS and CSS/Cusom CSS, and enter this:
For table headers, you can find the column name in the column settings:
Then add the following CSS:
My test table has columns "Name", "Product", "Date" and "Image", so my CSS would look like this:
And the outcome would be:
If you want to apply this to all tables, you can paste the CSS in Custom CSS field in Custom JS and CSS tab in main settings of wpDataTables. If, however, you wish to apply this only to a certain table on front-end, you need to add it when you're creating the page, above the shortcode, in between the <style>...</style> tags, like this:
Of course, you can add "color" instead of "backgroung-color" if you wish to change the font color.
I hope this helps.
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
HI Aleksandar,
The color setting kind of works for me. Can you give an example of aligning the text?? I use the follow css, but it doesn't seem to work
Hi again fangquans
You can use the same class you used for the color.
For example:
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