Table Column Alignment

Did align ever work on <col>?

Note

Message thread

Amelia Bellamy-Royds wrote on

OK, web standards nerds:

When/why did browsers stop supporting the HTML align attribute on table columns?

Yes, it’s deprecated in the specs along with all other uses of the align attribute, but there’s no other way to do table column alignment other than very fragile nth-child selectors to count out individual table cells per row, which don’t work for complex table layouts.

See this thread started by @simevidas & the basic test case:
https://jsbin.com/dotogah/edit?html,output
https://mastodon.social/@simevidas/111

Matthias Zöchling wrote on

In reply to: @AmeliaBR, @simevidas.

align still works on <th>/<td>, maybe it never did on <col>?

According to MDN it should, would be interesting to see if it did work at some point. When I have access to older browsers later today I’ll run some tests.

Matthias Zöchling wrote on

In reply to: @AmeliaBR, @simevidas.

This is hard, the old browsers cannot deal with https, and I cannot easily deploy an http-only test page. So far I can only say I found no https-capable browser (IE, Firefox, Safari, etc.) where align worked on <col>.

Join the conversation

Have your say on Mastodon, or simply share this thread on Twitter/X.