Title: Allow auto width for table
Last modified: August 21, 2016

---

# Allow auto width for table

 *  Resolved [bjoerne](https://wordpress.org/support/users/bjoerne/)
 * (@bjoerne)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/allow-auto-width-for-table/)
 * I use easy table for very small tables with just two columns. So the width of
   100% is not appropriate for me.
    Instead I prefer an automatic width (default
   of browser if no width is defined). I would like to have the possibility to declare‘
   auto’ as width. Actually this leads to an error as the value is parsed (must 
   be % or px). And I guess that ‘auto’ is not valid for the width attribute. Here
   is my solution as diff:
 *     ```
       216c216,218
       < 	$width = (stripos($width,'%') === false) ? (int)$width.'px' : (int)$width.'%';
       ---
       > 	if ($width != 'auto') {
       > 		$width = (stripos($width,'%') === false) ? (int)$width.'px' : (int)$width.'%';
       > 	}
       229c231,233
       < 	$output .= ' width="'.$width.'" ';
       ---
       > 	if ($width != 'auto') {
       > 		$output .= ' width="'.$width.'" ';
       > 	}
       ```
   
 * [http://wordpress.org/plugins/easy-table/](http://wordpress.org/plugins/easy-table/)

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

 *  Plugin Author [takien](https://wordpress.org/support/users/takien/)
 * (@takien)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/allow-auto-width-for-table/#post-4011886)
 * Fixed on version 1.1.3
    Thank you.
 *  Thread Starter [bjoerne](https://wordpress.org/support/users/bjoerne/)
 * (@bjoerne)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/allow-auto-width-for-table/#post-4011973)
 * That was fast. Thank you very much! Great work!

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

 The topic ‘Allow auto width for table’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/easy-table_aeb393.svg)
 * [Easy Table](https://wordpress.org/plugins/easy-table/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/easy-table/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/easy-table/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-table/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-table/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-table/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [bjoerne](https://wordpress.org/support/users/bjoerne/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/allow-auto-width-for-table/#post-4011973)
 * Status: resolved