0

The label doesn't get its width the same as the td it is inside of.

* {
  border: 1px solid black;
}

table {
  width: 100%;
}

table label {
  width: 100%;
}

table td:not(:nth-child(2)) {
  width: 16px;
}
<table>
  <tbody>
    <tr>
      <td></td>
      <td><label>hey</label></td>
      <td></td>
    </tr>
  </tbody>
</table>

How do I make the label the same width as its parent td?

theonlygusti
  • 11,032
  • 11
  • 64
  • 119

0 Answers0