Question About HTML Coding for Tables

Hi All -

I’m studying the Tables section in MDN and made my own very basic table in CodePen including the CSS from the lesson. I have some table headers expanding 2 rows with corresponding cell info which was fine.

But then just for curiosity I tried to add a table header in the same table spanning two columns and having two cells underneath this header that are horizontally displayed instead of vertically displayed and wasn’t able to do this?

Can you please let me know if this is possible and, if so, how you’d mark it up?

The link to my coding in CodePen is below:

https://codepen.io/codermom8/pen/BaoVLzv

Thanks so much!

hi jes
hope that everything going fine with you

the issue was that Favorite Outside Activities was outside any tr element so the code should be corrected as follow
revision copy of your work

hope that help have a nice day

1 Like

Thank you so much!

This makes total sense now, the start and end of a new row with <tr> wrapped around both cells under Favorite Outside Activities header.

Have a nice day too =)

you welcome
well done congratulations and thanks :slight_smile:

1 Like