Display: table using tables

I was wondering if it would be nice to use the CSS display property to emulate tables for a simple veeeery forum system.

I know that this was not good, like 2 years ago, when IE and possibly others did not support display: table / table-cell, etc. But I think that now all browsers support it, right?

+5
html css cross-browser css-tables
source share
8 answers

If the information displayed on the forum is tabular, then do not be afraid to use the table if it makes sense semantically.

For a general page layout, I personally would not use it. I would stick with typical div blocks and floating blocks. IE7 does not support display: table, and there are other caveats, for example, the fact that it will expand in width depending on the content. In the future, I look forward to when flexbox will be fully supported.

I sometimes use display: a built-in block to center the elements of a dynamic list, etc.

+3
source share

From personal display experience: table, etc. pretty redundant (someone will correct me if I am wrong)

It is best to use divs and style them using CSS accordingly.

Edit: ^ Without using display: table / display: table-cell. And using more common / standard methods of displaying your data. (However, it can be argued that this is a regular / standard method)

+2
source share

I would not mix structure (HTML) with style (CSS). If it is tabular data, just use <table> , if it is not, it is best to use divs / CSS.

+2
source share

I think that at the end you show tabular data, then the table is quite sufficient. I believe that when you use tables to control layout from a design point of view, purists will have a hard time, because from a theoretical point of view, your semantic markup will indicate tabular data, but in fact you can use it to position images. That being said, I was sometimes upset, trying to lay out things without using tables. I know that it frowned, but who is perfect.

+2
source share

display: table great for situations where you need a layout similar to a grid, but for non-tabular data. This is supported with IE8 , so you can definitely use it. If all browsers supported the CSS grid proposal , then I would say that display: table is basically useless, but not very good .

Personally, I think the forum is a great example of a mesh layout for non-tabular data. But in the past I talked about StackOverflow about what "tabular data" is; I am mistaken on the very strict side of “table 1: numbers and numbers,” while others seem to be inclined to believe that tablature is synonymous with “ordered grid”.

+2
source share

This can be useful, especially for vertically centering content. I would not use it for the entire layout, but this is only because I'm used to using float.

+2
source share

I also agree with Phil, tables for tabular data. I prefer using divs and spans than using tables where possible.

But if your data is tabular, like a grid, you can go with a table.

The same grid can be developed using only divs.

+2
source share

Now, most new browsers are fine. The best you can do is check it out in the browsers you care about. You can never make "all browsers" happy, no matter what you do.

I still use tables to structure my page in many cases. People are right when they say that you should use css instead, but the good grief, the amount of work you need to invest to make divs act as a grid properly in only one browser, not to mention all the major browsers, is still prohibitive . If you do not find a real (unlike theoretical / philosophical) problem with the table, then at the moment it is much more practical.

Perhaps when the css grid layouts become a suitable replacement, I repent of my evil <table> ways, but until then ...

+1
source share

All Articles