Our Biggest Sale Is Here
Up to 70% Off
Get the Deal

How to color and style columns in wpDataTables

Say your fruit price table has a column for apples, one for oranges and one for bananas, and you want each column in its own color: green, orange and yellow. Every column in wpDataTables has the same look by default, but you can give a column its own background color, align its content and add CSS classes for anything else, such as a bold font. You can do this with Tabella AI or in the column settings.

How do I color a column with Tabella AI?

Open the table, click Ask Tabella AI and name the column and the color.

  1. Open the table. Go to wpDataTables → wpDataTables and click the table title.
  2. Ask Tabella AI. Click Ask Tabella AI and type, for example: Color the Apples column light green.
  3. Check and save. Tabella AI lists what it changed. Click Save Changes, or Undo table changes to go back.

How do I color and style a column in the column settings?

Set Column color, the alignment or CSS class(es) in the Display tab of the column settings and save the table.

  1. Open the table. Go to wpDataTables → wpDataTables and click the table title.
  2. Open the column settings. In the table preview, click the settings icon in the column header, or open the column from Column List above the preview.
  3. Pick a color. In the Display tab, click Column color and choose the color in the color picker.
  4. Align the content. Choose Column header alignment and Column cells alignment, for example right for numbers.
  5. Add CSS classes. In CSS class(es), enter one or more class names separated by a space, for example price-column.
  6. Save the table. Click Save Changes.

How do I add CSS for a column class?

Write the CSS rules for your class in Custom wpDataTables CSS in the Customize tab of the table, in Custom JS and CSS in the wpDataTables settings, or in your theme. Each table also has its own class, wpDataTableID- followed by the table ID, so you can limit a rule to one table:

.wpDataTableID-2 td.price-column { font-weight: 700; color: #1a3a6b; }

To color cells or rows by their values instead of a whole column, use conditional formatting. To change the colors of the whole table, read How to customize the design of a table.

To right-align the numbers in all tables at once, turn on Align numbers to the right in wpDataTables → Settings.

What should I remember about coloring columns?

Ask Tabella AI for a column color, or set Column color, the alignment and CSS class(es) in the column’s Display tab. Write the CSS for your classes in the table’s Custom wpDataTables CSS, the plugin settings or your theme, and use .wpDataTableID- with the table ID to target one table.

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