Skip to content

Comment on 2014 CSS Report: Examining how CSS is being used in the wildparent

Comments

Depends on your definition of "easy"... assuming your markup is being generated on the server or using templates or whatever (in other words, a loop), you can add a different class to each table cell that is in the 2nd column.

Or if you don't need IE8 support you could use the nth-child selector (e.g. .my-table td:nth-child(2) { text-align: center; }).

In some cases I would argue one of these techniques would be cleaner / better than adding a <col> element just for a styling hook. But in other cases I agree with you that it would be nice if <col> styles propogated.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.