<h3>Summary</h3>

<p>What's the best way to ensure a table cell cannot be less than a certain minimum width. </p>

<h3>Example</h3>

<p>I want to ensure that all cells in a table are at least 100px wide regards of the width of the tables container. If there is more available space the table cells should fill that space.</p>

<h3>Browser compatibility</h3>

<p>I possible I would like to find a solution that works in</p>

<ul>
<li>IE 6-8</li>
<li>FF 2-3</li>
<li>Safari</li>
</ul>

<p>In order of preference.</p>

[{'answer_id': 56663, 'author': 'James B', 'author_id': 2951, 'author_profile': 'https://Stackoverflow.com/users/2951', 'pm_score': 7, 'selected': True, 'text': "<p>This CSS should suffice:</p>\n\n<pre><code>td { min-width: 100px; }\n</code></pre>\n\n<p>However, it's not always obeyed correctly (the min-width attribute) by all browsers (for example, IE6 dislikes it a great deal).</p>\n\n<p><strong>Edit:</strong> As for an IE6 (and before) solution, there isn't one that works reliably under all circumstances, as far as I know.  Using the nowrap HTML attribute doesn't really achieve the desired result, as that just prevents line-breaks in the cell, rather than specifying a minimum width.</p>\n\n<p>However, if nowrap is used in conjunction with a regular cell width property (such as using width: 100px), the 100px will act <em>like</em> a minimum width and the cell will still expand with the text (due to the nowrap).  This is a less-than-ideal solution, which cannot be fully applied using CSS and, as such, would be tedious to implement if you have many tables you wish to apply this to.  (Of course, this entire alternative solution falls down if you want to have dynamic line-breaks in your cells, anyway).</p>\n"}, {'answer_id': 56667, 'author': 'Jeffrey04', 'author_id': 5742, 'author_profile': 'https://Stackoverflow.com/users/5742', 'pm_score': 2, 'selected': False, 'text': '<p>what about this css property</p>\n\n<pre><code>min-width: 100px\n</code></pre>\n\n<p>but it doesn\'t really work in IE6 if not mistaken</p>\n\n<p>if you don\'t want to do it in the css way, I suppose you can add this attribute </p>\n\n<pre><code>nowrap="nowrap"\n</code></pre>\n\n<p>in your table data tag</p>\n'}, {'answer_id': 56685, 'author': 'Michael Haren', 'author_id': 29, 'author_profile': 'https://Stackoverflow.com/users/29', 'pm_score': 3, 'selected': False, 'text': '<p>Another <strong>hack</strong> is the old 1x1 transparent pixel trick. Insert an 1x1 transparent gif image and set its width in the image tag to the width you want. This will force the cell to be at least as wide as the image.</p>\n'}, {'answer_id': 56738, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>IE6 handles width as min-width:</p>\n\n<pre><code>td {\n    min-width: 100px;\n    _width: 100px;/* IE6 hack */\n}\n</code></pre>\n\n<p>If you want IE6 to handle width like normal browsers, give it an overflow:visible; (not the case here)</p>\n'}, {'answer_id': 1007998, 'author': 'Dean Peters', 'author_id': 441512, 'author_profile': 'https://Stackoverflow.com/users/441512', 'pm_score': 2, 'selected': False, 'text': '<p>I had some success with:</p>\n\n<pre><code>    min-width: 193px;\n    width:auto !important; \n    _width: 193px;  /* IE6 hack */\n</code></pre>\n\n<p>Based on a combination of Vatos\' response and a min-height article here: <a href="http://www.dustindiaz.com/min-height-fast-hack/" rel="nofollow noreferrer">http://www.dustindiaz.com/min-height-fast-hack/</a></p>\n'}, {'answer_id': 5098023, 'author': 'Prof', 'author_id': 629157, 'author_profile': 'https://Stackoverflow.com/users/629157', 'pm_score': 2, 'selected': False, 'text': '<p>This is a cross-browser way for setting minimum width and/or mimimum height:</p>\n\n<pre><code>{\nwidth (or height): auto !important;\nwidth (or height): 200px;\nmin-width (or min-height): 200px;\n}\n</code></pre>\n\n<p>IE 6 doesn\'t understand !important<br>\nIE 6 sees width/height:200px (overwriting auto)</p>\n\n<p>Other browsers understand the min- and the !important</p>\n\n<p>I am not 100% familiar with the behaviour of widths in TD elements, but this all works nicely on eg DIV tags</p>\n\n<p>BTW:</p>\n\n<blockquote>\n  <p>Based on a combination of Vatos\' response and a min-height article here: <a href="http://www.dustindiaz.com/min-height-fast-hack/" rel="nofollow">http://www.dustindiaz.com/min-height-fast-hack/</a></p>\n</blockquote>\n\n<p>This is not working because of the order of the first 2 lines, they need to be in the right order (think about the above) ;)</p>\n'}, {'answer_id': 7225831, 'author': 'Partack', 'author_id': 478222, 'author_profile': 'https://Stackoverflow.com/users/478222', 'pm_score': 3, 'selected': False, 'text': "<p>I know this is an old question but i thought I'd share something that wasn't mentioned (Although pretty simple in concept..) you can just put a <code>&lt;div&gt;</code> inside the table (in one of the <code>&lt;td&gt;</code>'s or something) and set the <code>&lt;div&gt;</code> to <code>min-width</code>. the table will stop at the <code>&lt;div&gt;</code>'s width. Just thought I'd throw that out there in case somebody comes across this on google. Also, I'm not so sure about how min-width is handled in I.E6. but that has already been covered in another answer.</p>\n"}]
['https://Stackoverflow.com/questions/56658', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5182/']