I am trying to make a 2 column layout, apparently the bane of CSS. I know you shouldn\'t use tables for layout, but I\'ve settled on this CSS. Note the use of display: table
You said using display:table for a great auto-width like columns?
I can't use css float, because I want the columns to expand and contract with the available space.
Then, you could also use flex properties! Let's get in that:
In CSS3 there were many properties added, there's one group called flex which is used to have flexible divs without using tables or display: table; also used when the user's using a small screen (maybe a mini laptop, tablet, big smartphone like Galaxy series or small...?). These are the properties:
-webkit- before the value (inline-flex's also applicable) for Google and Safari support. You don't need to use -moz- or -o-, nor -ms-.row, column, row-reverse, or column-reverse. Because of you want a main div and a sidebar, ya shall use column. Use -moz- and -webkit- for more browser support.main (not recommended) or div class="main" and aside or div class="sidebar".-moz- n -webkit- plz.-webkit- & -moz- r Rcomment ed.Moar info at: http://css-tricks.com/snippets/css/a-guide-to-flexbox/ and http://www.w3schools.com/cssref/default.asp#flexible.
Oh, and here's the answer: yes, you can use it. Read at: http:/www.w3.org/TR/css3-flexbox/#intro. It says
table layout, designed for laying out 2D data in a tabular format
They doesn't talk about bad idea, it just sets its format to ACT (and maybe don't look like) like a table.