Problem: setting table’s column width by CSS or by setting options in UI is not very intuitive in the current wpDataTables version.

There are some steps to achieve the custom table column width.

  1. Changing the width of columns is only possible if you disable the “Scrollable” feature in the “Display” tab above the table, and enable “Limit table width“.
  2. enable “Limit table width”, “Word wrap” is optional
  3. Then new option (“Column Width”) will appear in column settings, but this will only be applied to desktop view:
  4. Wordpress wpDataTables setting column width

    WordPress wpDataTables setting column width

To make it work in the same way for mobiles and tablets, you’d need to include custom media queries.

You can add CSS in Custom CSS section of the Customize tab above the table (or in Custom CSS in wpDataTables Settings)

Copy to Clipboard

Share This Story..

About the Author: markoze

I'm an exploring artist, illustrator and creator of digital media (2D graphics, illustrations and 3D designs). I share my works, tutorials, tips, free art, items and tools. I also create websites (and apps) for organizations, communities, groups, people movements, faith organizations and more.
Published On: February 13th, 2024Categories: DataTables, Tips, WordpressTags: ,
What does it take to build a new website

Products, addons and solutions I recommend

  • Disclosure info: images and links here maybe affiliate links and promotions.