table layout fixed and column width 1%

Viewed 18

Is it possible to have table-layout: fixed and set the column width to 1% avoiding collapsing content inside the column?

For example:

<table>
  <tr>
    <td class="td1">content</td>
    <td class="td2">longer content</td>
    <td class="td3">this should stretch`</td>
  </tr>
</table>

Then:

table {
  width: 100%;
  table-layout: fixed;
}
td {
  border: 1px solid #000;
}

.td1, .td2 {
  width: 1%;
  white-space: nowrap;
}

This will occur with collapsing width of the first and second <td>, and the content overflows the <td> elements.

Changing the table-layout to auto solves the issue and the width of two <td> adjusts to the content inside.

Is it feasible with table-layout: fixed

0 Answers
Related