Black friday Black friday Black friday Cyber monday Cyber monday Cyber monday
Up to 70% off Up to 70% off
Grab Yours

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

If you need to apply for all tables then 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 CUSTOM CSS under Customize tab in table settings and you will use clases with id’s for that table (Example if your table have id 1)

.wpDataTablesWrapper table.wpDataTable.wpDataTableID-1 td,
​.wpDataTablesWrapper table.wpDataTable.wpDataTableID-1 th,
.wpDataTablesWrapper table.wpDataTable.wpDataTableID-1 td.numdata,
​.wpDataTablesWrapper table.wpDataTable.wpDataTableID-1 th.numdata
{ text-align: center !important; }
Was this answer helpful ? Yes No

Comments are closed.

Wait, Before You Download!

To get your hands on wpDataTables Lite, please enter your email address below. We’ll send you a direct download link and keep you updated on existing features along with helpful tips and tricks!

By continuing, I accept Privacy Policy and T&C
Mail Box