# Question About HTML Coding for Tables

**URL:** <https://discourse.mozilla.org/t/question-about-html-coding-for-tables/59793>\
**Category:** Learn\
**Created:** [May 11, 2020, 5:04pm UTC](https://discourse.mozilla.org/t/question-about-html-coding-for-tables/59793 "2020-05-11T17:04:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JES](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/jes/32/37019_2.png) [@JES](https://discourse.mozilla.org/u/JES)\
**Post date:** [May 11, 2020, 5:04pm UTC](https://discourse.mozilla.org/t/question-about-html-coding-for-tables/59793/1 "2020-05-11T17:04:07Z")

</div>

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](https://codepen.io/codermom8/pen/BaoVLzv)

Thanks so much!

---

<div class="post-metadata">

**Author:** ![justsomeone](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/justsomeone/32/67787_2.png) [@justsomeone](https://discourse.mozilla.org/u/justsomeone)\
**Post date:** [May 11, 2020, 6:36pm UTC](https://discourse.mozilla.org/t/question-about-html-coding-for-tables/59793/2 "2020-05-11T18:36:19Z")

</div>

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](https://jsfiddle.net/g86tdbe5/)

hope that help have a nice day

---

<div class="post-metadata">

**Author:** ![JES](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/jes/32/37019_2.png) [@JES](https://discourse.mozilla.org/u/JES)\
**Post date:** [May 11, 2020, 7:12pm UTC](https://discourse.mozilla.org/t/question-about-html-coding-for-tables/59793/3 "2020-05-11T19:12:47Z")

</div>

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 =)

---

<div class="post-metadata">

**Author:** ![justsomeone](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/justsomeone/32/67787_2.png) [@justsomeone](https://discourse.mozilla.org/u/justsomeone)\
**Post date:** [May 11, 2020, 7:18pm UTC](https://discourse.mozilla.org/t/question-about-html-coding-for-tables/59793/4 "2020-05-11T19:18:35Z")

</div>

you welcome  
well done congratulations and thanks 🙂
