I am facing a challenge with an html table where the column is set to a fixed width using table-layout: fixed
, but it still expands to accommodate text without spaces. Is there a solution for this issue other than wrapping each td content in a div?
For reference, here is an example: http://jsfiddle.net/6p9K3/29/
<table>
<tbody>
<tr>
<td style="width: 50px;">Test</td>
<td>Testing 1123455</td>
</tr><tr>
<td style="width: 50px;">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</td>
<td>B</td>
</tr>
</tbody>
</table>
table
{
table-layout: fixed;
}
td
{
border: 1px solid green;
overflow: hidden;
}
The provided example clearly demonstrates how the column with long text expands beyond the specified 50px width.