Assessment needed for table styling test

Could someone kindly check my work on table styling test?

The final result looks similar enough to the example, but I’m not sure my code is correct and optimised…

Thank you for your help :blush:

My work

Test

Great work again, @Risa!

You’ve correctly analyzed the situation in you comment at the end. :slightly_smiling_face:

The one thing that could be optimized are the alignment rules. You can leave out thead and tbody and instead redefine the alignment for tfoot. This will reduce the amount of selectors from nine to six:

tr :nth-child(2),
tr :nth-child(3),
tfoot tr :nth-child(1) {
  text-align: right;
}

tr :nth-child(1),
tr :nth-child(4),
tfoot tr :nth-child(2) {
  text-align: left;
}

Have a nice weekend,
Michael

1 Like

Thank you so much Michael! :blush:

I thought the way I aligned those columns had too many selectors, but couldn’t think of how I could optimise. Your advice is super helpful! :clap:

I haven’t thought about styling big groups first and then re-style some of them to make them different from the rest. This is a great tip!

Thank you so much! Have a nice weekend :slight_smile:

1 Like