The source of the problem seems to be that firefox is ignoring your width: 1170px;
on the table and using the width: 200px;
on the wrapper. Adding a min-width: 1170px;
to the table fixes your problem, but I can't be sure if this is acceptable without additional details.
Edit: Actually, if the <td>
content always has to be restricted to a single line, you can use white-space: nowrap
for the <td>
and it should work properly. Tested in FF22 on a MBP.
Edit 2: So after looking through the Bootstrap CSS file, I noticed this:
table {
background-color: transparent;
border-collapse: collapse;
border-spacing: 0;
max-width: 100%;
}
Since Bootstrap sets a max-width: 100%
on tables, the browser will ignore any width you set if it's greater than the width of the tables parent element. So removing the max-width
, adding a min-width
, or explicitly telling your browser that you don't want line breaks using white-space: nowrap
will all fix your issue. I'd recommend just removing the max-width
from Bootstrap if you don't need it.
Anyway, this still leaves the question of why Firefox and Chrome behave differently when given the same content. While looking into this, I saw this SO question, which explains why it seemed like the max-width
was ignored by Chrome.
From the W3C Specification for Tables:
In terms of the visual formatting model, a table can behave like a block-level (for 'display: table') or inline-level (for 'display: inline-table') element.
Checking out the User Agent styles for Chrome and FF, they both add a display: table
. So strictly following the specs, the overflow: hidden
should be failing in both browsers. Looks like in this case, Chrome is misinterpreting the specs slightly, while FF is strictly adhering to it.