Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

nvcxnvkldsjaklfds
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,440 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,440 PointsMaciej Czuchnowski
36,440 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.