skip to Main Content

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;
}

2

Answers


  1. 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

    Login or Signup to reply.
  2. I know this is a late answer but this will help anyone that google search

    Based on @mujuonly answer

    need to add priority like 998

    add_action('admin_enqueue_scripts', 'wc_product_list_css_overrides', 998);
    
    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%; }");
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search