10

Recently I asked a question here and one of the answer suggests to use display: table and display: table-cell css properties.

Generally UI designers recommend not to use tables for layout. What if I use these two css properties extesively while layout? Is it the same as using tables for layout?

Community
  • 1
  • 1
Krishna Chaitanya
  • 2,533
  • 4
  • 40
  • 74
  • What you call "extesively" ? You may use `` for tabular data and CSS displays to get things like vertical-align or fill remain space no more.
    – DaniP Dec 19 '13 at 12:39
  • Possible duplication: http://stackoverflow.com/questions/6629857/displaytable-versus-using-tables or http://stackoverflow.com/questions/6307934/is-there-a-disadvantage-of-using-displaytable-cellon-divs/6307988#6307988 – damian Dec 19 '13 at 12:39
  • @Danko I meant can I use display: table and display: table-cell always whereever possible while layouting the page. – Krishna Chaitanya Dec 19 '13 at 12:42

2 Answers2

17

No. HTML tables indicate that their contents are tabular data. This information is exposed to the Accessibility API and so accessibility tools like screen readers can tell their users what to expect in the information following. Note that cell headers may be read out multiple times so that the AT user can orientate themselves while following the data.

CSS tables do not behave like that. They are just layout instructions. The information about the data that the AT user gets will reflect the semantics of the HTML, not the CSS layout.

Alohci
  • 78,296
  • 16
  • 112
  • 156
3

The display table let the element behave like a element without using a HTML table element, so probably you will have more flexibility on your development. So you will have the benefits of a table and the flexibility of development without table, becase tables are always difficult and and hard to work

Rafa Romero
  • 2,667
  • 5
  • 25
  • 51
  • 2
    Sorry, I find this answer unsatisfying. Do you mean "division" (div) instead of "development"? What is the supposed flexibility? Why are tables "always" difficult to work with? I honestly don't know the answer. – ChrisoLosoph Dec 08 '21 at 20:36