Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to adjust the column size of WooCommerce admin products table

I have added some extra columns in my WooCommerce admin products list but the columns are not adjusted according to values and I have the following problem
enter image description here

How can I change CSS of the table

table.fixed {
   table-layout: fixed;
}

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

add_action('admin_enqueue_scripts', 'wc_product_list_css_overrides');

function wc_product_list_css_overrides() {
    wp_add_inline_style('woocommerce_admin_styles',
            "table.wp-list-table .column-sku{ width: 9%; } table.wp-list-table .column-name{ width: 20%; } table.wp-list-table .column-is_in_stock{ width: 7%; }");
}

Please take the corresponding column name and enter the width value desired like the example given.

Add the above code in your active theme functions.php file

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading