

That is substantiated by the fact that the major email sending services still all offer templates as tables. You can do some progressive enhancement for emails, but the layout itself is still generally regarded as being safest done in tables.
CSS DISPLAY TABLE CELL MARGIN NOT WORKING PLUS
It is everything we deal with on the web, plus the world of native apps on both mobile and desktop on operating systems new and ancient. The landscape of what renders emails is super wide.

Rarely do you see modern websites touch tables for layout. We’re seeing the fragility of floats in the olden days fade away. We’re seeing inline-block be used powerfully. We’re seeing grid layout starting to grow up. We’re seeing flexbox being awesome and being right on the edge of mainstream usability. We’re seeing a lot more use of fixed and absolute positioning which you cannot do inside a table. If you are somehow absolutely stuck using table tags for layout, use the ARIA role="presentation" on the table to indicate it as such.Īs I write this in the latter half of 2013, tables have become far less prevalent and even appealing as a layout choice. If you really need the layout abilities of a table but want to use semantic tags, see the next section. A table would dictate that table comes first in the source order, which while also being bad for accessibility, is likely bad for SEO as well, potentially valuing your ancillary content above primary content.Ĭould you fix the SEO issues by using semantic tags within the table tags? Possibly somewhat, but now you’re using double the HTML. Speaking of source order, that affects more than accessibility. Not to mention a screen reader may even announce the start of tabular data which would be worse than useless. That means the order of how your site is presented is dictated by the table structure, which is dictated by visual choices not accessibility choices. Screen readers read tables from top to bottom, left to right. One part of accessibility is screen readers. Talking about semantics is a little difficult sometimes (some reads: 1, 2, 3, 4, 5), so let’s talk about something we all generally agree on (even if we aren’t as good as it as we want to be): websites should be accessible. You aren’t going to get a fine in the mail, but you aren’t getting as much value from your HTML as you could. Using them for anything else is a breach of semantic duty. As we covered, table elements semantically describe tabular data. There are some significant problems with using tables for layout though. Easy to control, extremely logical, predictable, and not-at-all fragile. At a glance at how tables work may make them seem ideal for layout. When Not To Use TablesĪn inappropriate use for tables is for layout. Tables are the right choice when that is the case.

That’s not true – they semantically indicate tabular data. You might occasionally hear: tables are unsemantic. What kinds of things are appropriate in tables? Here are some: a plan/pricing/features comparison, bowling scores, an internal grid of employee data, financial data, a calendar, the nutrition facts information panel, a logic puzzle solver, etc. The “would this make sense in a spreadsheet?” test is usually appropriate. Perhaps you’ve heard the generic advice: tables are for tabular data (see the first sentence of this blog post). It’s a good time to take a break and discuss the when of tables. Just make on row of all and then each subsequent row with the first cell only as. It’s just no more important than the vertical column of headers so it feels weird to group that top row alone.

display: table-* options are supported in any recent browser, and from IE8 onwards.I might skip a in this situation even though that first row is all header. Ideally we strive to separate semantic mark-up and presentation, so tags should be reserved for data that’s structured in a table format, and if you just want a grid layout that behaves a bit like a table, use tags with display: table-cell instead. The styling is used to make elements, such as tags behave like and tags. I’ve been using display: table-cell and display: table in CSS for a couple of different projects recently and have been impressed by the results. Using CSS “display: table-cell” for columns
