{"id":4011703,"date":"2013-08-09T11:32:56","date_gmt":"2013-08-09T11:32:56","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/allow-auto-width-for-table\/"},"modified":"2016-08-21T03:46:38","modified_gmt":"2016-08-21T03:46:38","slug":"allow-auto-width-for-table","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/allow-auto-width-for-table\/","title":{"rendered":"Allow auto width for table"},"content":{"rendered":"<p>I use easy table for very small tables with just two columns. So the width of 100% is not appropriate for me.<br \/>\nInstead I prefer an automatic width (default of browser if no width is defined).<br \/>\nI would like to have the possibility to declare &#8216;auto&#8217; as width. Actually this leads to an error as the value is parsed (must be % or px). And I guess that &#8216;auto&#8217; is not valid for the width attribute.<br \/>\nHere is my solution as diff:<\/p>\n<pre><code>216c216,218\n&lt; \t$width = (stripos($width,&#039;%&#039;) === false) ? (int)$width.&#039;px&#039; : (int)$width.&#039;%&#039;;\n---\n&gt; \tif ($width != &#039;auto&#039;) {\n&gt; \t\t$width = (stripos($width,&#039;%&#039;) === false) ? (int)$width.&#039;px&#039; : (int)$width.&#039;%&#039;;\n&gt; \t}\n229c231,233\n&lt; \t$output .= &#039; width=&quot;&#039;.$width.&#039;&quot; &#039;;\n---\n&gt; \tif ($width != &#039;auto&#039;) {\n&gt; \t\t$output .= &#039; width=&quot;&#039;.$width.&#039;&quot; &#039;;\n&gt; \t}<\/code><\/pre>\n<p>https:\/\/wordpress.org\/plugins\/easy-table\/<\/p>\n","protected":false},"template":"","class_list":["post-4011703","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4011703","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4011703\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4011703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}