Learn More About CSS Pseudo Selectors By Building A Balance Sheet - Step 53

I don’t get why the tbody th width should be set to calc(100% - 12rem).

tbody th {
  width: calc(100% - 12rem);
}

I haven’t understood the reason behind this specific width. If the width is not set it seems to work just the same. (And why 12rem?)

Thanks in advance.

Challenge: Learn More About CSS Pseudo Selectors By Building A Balance Sheet - Step 53

Link to the challenge:

Ya, it does seem like this might not be necessary since the three tds are each set to a width of 4rem and the th appears to automatically take up the rest of the space by default. But I haven’t tested it completely so I could be wrong and it may need to be there for a very specific reason.

Because you want it to take up all the remaining available space. So if the three tds take up 4rem each then that is a total of 12rem and thus the th should take up 100% of the space minus the 12rems that the three tds occupy.

1 Like

Thanks a lot. I had not paid attention to the tds width.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.