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@mastodon.social & the basic test case:
https://jsbin.com/dotogah/edit?html,output
https://mastodon.social/@simevidas/111766317215896762

Matthias Zöchling wrote on

In reply to: @AmeliaBR@front-end.social, @simevidas@mastodon.social.

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@front-end.social, @simevidas@mastodon.social.

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>.

Get involved

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