Please wait...

How to center text in the table?By Milan Jovanovic on 20/07/18 in

Just add this code below in Custom wpDataTables CSS under the “Custom JS AND CSS” in main settings of wpDataTables. In this example we align the text in the center of the table, you can change the text-align to your desire by changing the word “center” to “left” or “right.

.wpDataTablesWrapper table.wpDataTable td, 
.wpDataTablesWrapper table.wpDataTable th,
.wpDataTablesWrapper table.wpDataTable td.numdata, 
.wpDataTablesWrapper table.wpDataTable th.numdata
{ text-align: center !important; }

This will be affected on all tables, but if you want just for specific one then insert this code on the page where is that table between the style tag (<style>Code here</style>).

<style>
.wpDataTablesWrapper table.wpDataTable td, 
.wpDataTablesWrapper table.wpDataTable th,
.wpDataTablesWrapper table.wpDataTable td.numdata, 
.wpDataTablesWrapper table.wpDataTable th.numdata
{ text-align: center !important; }
</style>
Was this answer helpful ? Yes (7) No (0)

Comments are closed.

Do you have the best

essential plugins installed?
Grab the best 46 plugins. Tested and sorted.

Plugins for SEO, Caching, Security, Design and UX, Stats & analytics, Social sharing. Only the best ones.

By clicking "subscribe" you consent that the information you provide via this form will be securely processed and stored in compliance with EU privacy laws (GDPR).

Thank you for subscribing!

Please check your inbox to download the WordPress goodies.