Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

html table vs css display table

Tags:

html

css

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?

like image 592
Krishna Chaitanya Avatar asked Dec 19 '13 12:12

Krishna Chaitanya


2 Answers

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.

like image 91
Alohci Avatar answered Oct 13 '22 01:10

Alohci


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

like image 40
Rafa Romero Avatar answered Oct 12 '22 23:10

Rafa Romero