You could use display:inline-block instead of float. Many developers have used tables for all sorts of tasks in the past. Style your tables using the CSS below. The two top reasons for using Divs instead of Tables are 1) Divs fill whatever horizontal space is available and 2) they require less code. The ability of a Div to fill the space is just a nice feature to have - … When the desired option has been set in the dropdown you can optionally specify up the remaining settings in the allocated boxes. However, tabular arrangements are also useful for creating forms to ensure the various elements align in a predictable manner. First you need to select whether you want to generate a standard HTML Table or you'd rather use styled Div blocks to layout the grid. Viewing a list of products in a browse or search result shows, in general, a list of products in tabular … With divs, the developer must use the style attribute or an external style sheet, because the div tag doesn’t have any attributes attached to it. Also, tables don’t break when the content is too wide. Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. 12 February 2008. Your HTML says what something is (e.g. a table, a paragraph, or a generic text division) CSS is just instructions for displaying it. So that's as far as I want to take this today. The preference for not using tables for layout is also semantic: tables are for, well tables: tables of data, tables of pictures, tables … Just set widths of about 50% (adjust depending on padding, margins and borders) for the left and right containers and make them inline-block. Tables render the same in most all browsers, and even using them doesnt mean i have to stop using CSS! Using the DIV tag to display columns rather than tables. A few divs, knowing how to float and clear, can do the trick with a lot less markup than a table. Despite their status as mortal enemies, divs and tables can work together if you need them to. The 4 simple steps: Paste your table in the editor. I specify all of my cell properties in CSS, including dimensions, borders, and backgrounds. With divs, the developer must use the style attribute or an external style sheet, because the div tag doesn’t have any attributes attached to it. But, is it acceptab... Stack Exchange Network. all the above is very good but ... until all experimental css properties aren't available on browsers, you'll find out that is very hard to replace tables with divs dl dt dd elements about vertical align or background height, where it need to be the same when for example, you're resizing window or in the case of a dl dt dd with nested divs, and wrapping text inside. Make sure the cleaning option Replace table tags with divs is enabled. Using div is better than using table because of easy control of the in the design and it can be container for controls than table and the table is mainlt used to group data with simillar structure so it's design is for this task but div is considered as container mainly than table. I would like to achieve 3 cells, where first and last should be exactly 50px, and the middle the rest of the space of the main div. Clean the document. Using divs is not hard, once you learn the techniques. 2019 Update: I keep this post in place because for some unknown reason it has always done extremely well on Google searches, generating a gratifyingly large number of visits.I guess it explains the subject well and formatting HTML-based columns using DIV tags was an entry-level skill back in the day. Columns are not squeezed under other columns as they are in a div-based structure. Columns are not squeezed under other columns as they are in a div-based structure. Take ecommerce sites, for example. Also, tables don’t break when the content is too wide. This adds to the feeling that using tables is safe. I would love to use divs for my layout, but most times in the end it just isnt practical. Because of the ability to use vertical centering in tables, it is a somewhat popular technique to use a single-celled table with both horizontal and vertical centering to absolutely center your page content in a browser window (mostly only useful for fixed-size content). I would like to achieve 3 cells, where first and last should be exactly 50px, and the middle the rest of the space of the main div. Using tables for layout is discouraged because it is semantically wrong -- table markup is supposed to be for tables and specifically for tabular data.