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 trialShreyash Agarwal
9,843 PointsAdd colspan attribute to tr instead of td?
I think it's a better idea to add the colspan attribute to the tr element instead of the td element in a footer, considering we have only one element inside it.
Would this work?
2 Answers
David Bilson
13,819 PointsJoe,
The table is a 3 column table, but you only have 1 column in your tfoot element.
You are right that in saying that a tr element with only one td cell in it is a single column.
What you cannot see, due to the styling of the table, is that you have a huge gap to the right where the td cells for the other 2 columns should be.
See codepen http://codepen.io/anon/pen/bdbabo
Now see the codepen with the colspan spanning all 3 columns: http://codepen.io/anon/pen/aOoEog
AR Ehsan
7,912 Pointscolspan is needed to span the sentence like done in the video. It looks much better!
Joe Rizza
8,513 PointsJoe Rizza
8,513 PointsI'm confused- If you have a tr element with only one element inside it, isn't that one column? Why is colspan needed?
Maybe I misunderstood you. Can you please post some code to demonstrate what you are trying to accomplish?
Thanks!