Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJoseph Belanger
1,988 Pointsadding multiple tables?
when adding multiple tables using HTML, could you use the tags <table1> and so on? or would you have to assign an ID to each table?
2 Answers
Jonathan Grieve
Treehouse Moderator 91,253 PointsNo, you don't need to add id's to each table but each nested table should be inside a <table> tag or a table cell. TD tag. It's just about how you use the tags to get the nested tables on the screen. :-)
Jonathan Grieve
Treehouse Moderator 91,253 Pointsyou're welcome :)
Joseph Belanger
1,988 PointsJoseph Belanger
1,988 Pointsso would using the tags [table1] and so on work as well?
Jonathan Grieve
Treehouse Moderator 91,253 PointsJonathan Grieve
Treehouse Moderator 91,253 PointsI'm not sure what you mean. There's no <table1> <table2> tag etc. It's just table. All you're doing is making one table element a "child" of another. i.e. one element is inside the other.
As you suggested though you can name your elements with an ID. <table id = "table1"> </table>
This also provides a way you can select specific table elements with CSS.
Joseph Belanger
1,988 PointsJoseph Belanger
1,988 Pointsokay yes that is what i was trying to ask, adding an id will be for using css later on, but i was wondering if using the tag [table1] like we use with headers (h1,h2,h3) would save time and make it easier. but from what i understand, the answer is no and using an id is the way to go.
Jonathan Grieve
Treehouse Moderator 91,253 PointsJonathan Grieve
Treehouse Moderator 91,253 PointsYes, you're on the right track with ID's, but what I tried to say in my last post (but failed because I didn't use forum markdowns) is that table tags don't work the same way as the H1 to H7 tags. There's only one table element. :-)
Joseph Belanger
1,988 PointsJoseph Belanger
1,988 Pointsperfect. thank you for answering my question, you were very helpful !