1

In this example, when you hover over The longest name of all, you'll see that the table's width extends.

Is there any way to stop this from happening other than adding a width to the table (in my unique situation I cannot use this).

I was hoping for a fix like box-sizing: border-box or something like that.

th,
td {
  border: 1px solid #dddddd;
}

tr:hover {
  font-weight: bold;
}
<table>
  <tr>
    <th>Name</th>
  </tr>
  <tr>
    <td>Something name</td>
  </tr>
  <tr>
    <td>Short name</td>
  </tr>
  <tr>
    <td>The longest name of all</td>
  </tr>
</table>
Gosi
  • 2,004
  • 3
  • 24
  • 36
Paul Kruger
  • 2,094
  • 7
  • 22
  • 49

0 Answers0