Title: thermal printer columns width
Last modified: December 21, 2023

---

# thermal printer columns width

 *  [norisknofun11](https://wordpress.org/support/users/norisknofun11/)
 * (@norisknofun11)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/thermal-printer-columns-width/)
 * Again thanks for the great plugin!
   I am printing orders on a thermal printer,
   configured with CSS (@media print).Everything works fine but I have 3 products
   where the name is too long (31 characters without spaces) and when I print, the“
   product” column becomes so wide that the “total” column doesn’t print.I tried
   to change the column widths with CSS but without success 🙁Does anyone have a
   solution?Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [nick1122](https://wordpress.org/support/users/nick1122/)
 * (@nick1122)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/thermal-printer-columns-width/#post-17296196)
 * Hi,
   Here’s a filter that can set the long size of the product name. Add this 
   code snippet in functions.php file of your currently active theme.
 *     ```wp-block-code
       function custom_wcdn_order_item_name($product_name, $item) {
           if (strlen($product_name) > 5) {
               $product_name = '<span class="wrap-product-name">' . esc_html($product_name) . '</span>';
           } else {
               $product_name = '<span>' . esc_html($product_name) . '</span>';
           }
           return $product_name;
       }
       add_filter('wcdn_order_item_name', 'custom_wcdn_order_item_name', 10, 2);
       ```
   
 * After this, please follow the below steps.
   1. Download the CSS file in this link–
   [https://www.dropbox.com/scl/fi/ga0a1qyw9wx8l6xinggpe/style.css?rlkey=itdzbmuu3vfuqewxka4zwluh0&dl=0](https://www.dropbox.com/scl/fi/ga0a1qyw9wx8l6xinggpe/style.css?rlkey=itdzbmuu3vfuqewxka4zwluh0&dl=0)
   2. After downloading the file, you can replace it with the original file in the\
   wp-content\plugins\woocommerce-delivery-notes\templates\print-order folder.3.
   The css makes the necessary changes to fix the name in 80mm thermal printer.Screenshot
   for your reference: [https://prnt.sc/d50hroi1AG_c](https://prnt.sc/d50hroi1AG_c)
   Please let me know if the provided solution resolves your issue.Regards,Nikhil.
 *  Thread Starter [norisknofun11](https://wordpress.org/support/users/norisknofun11/)
 * (@norisknofun11)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/thermal-printer-columns-width/#post-17298755)
 * thank you very much! it works perfectly.
   however, I preferred to put the change
   in the style.css file in a snippet function

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘thermal printer columns width’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-delivery-notes/assets/icon-256x256.jpg?rev=2829362)
 * [Print Invoice & Delivery Notes for WooCommerce](https://wordpress.org/plugins/woocommerce-delivery-notes/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-delivery-notes/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-delivery-notes/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-delivery-notes/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-delivery-notes/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-delivery-notes/reviews/)

## Tags

 * [thermal printer](https://wordpress.org/support/topic-tag/thermal-printer/)

 * 2 replies
 * 2 participants
 * Last reply from: [norisknofun11](https://wordpress.org/support/users/norisknofun11/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/thermal-printer-columns-width/#post-17298755)
 * Status: not resolved