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 trialnvcxnvkldsjaklfds
Courses Plus Student 5,041 PointsHow to use HTML table's colspan and scope attributes in CSS file?
I was wondering can we use HTML table's attributes such as colspan and scope in CSS file?
I have tried to use colspan but it does not get spanned across three columns.
It seems we can't scope and colspan attributes in CSS file. Anyone here know why?
Thanks in advance
2 Answers
Maciej Czuchnowski
36,441 PointsColspan is structural, so it shouldn't be manipulated by CSS, which is used for style. I can imagine using colspan and scope in a lot of ways with jQuery though.
Jonas Guedes
8,751 PointsGood point Maciej. Use jQuery with Colspan
Lorenzo Pieri
19,772 PointsLorenzo Pieri
19,772 PointsWould you mind tellin' me those few ideas of yours about the jQuery usage?
Maciej Czuchnowski
36,441 PointsMaciej Czuchnowski
36,441 PointsYou could target specific tables or rows or cells depending on whether they have specific colspans or scopes. Use these attributes in IF statements. What if your table gets bigger and you add columns dynamically? Then you can increase colspans for footers if that happens. Whenever you want to manipulate structure, these two could come in handy.