Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Divs vs tables for tabular data

Tags:

html

css

tabular

Yes, another divs vs tables questions...

I read all over the place that "try to use divs instead of tables", but I have an application that displays data that is tabular, basically my entire web application displays tables (with different columns and data) but everything is tabular... Should I use struggle to use divs? If yes, why?

like image 842
WebGUY Avatar asked Jul 09 '11 21:07

WebGUY


People also ask

Can div be used in a table?

secondly, you can put "div" tag inside "td" tag. Further questions are always welcome. "Div and Table are both block level elements. so they can not be nested" - of course block level elements can be nested.

What is div and table?

What is a Table? As the name goes, table is a set of rows and columns. Defining using div, a table could be called as a set of div elements representing rows and columns. Following can be called as a table consisting of three rows. <div> <div> Text 1 </div> <div> Text 2 </div> <div> Text 3 </div> </div>

Are TABLEs good for SEO?

Are HTML tables SEO friendly? Yes they are SEO friendly if used correctly. Use them only for tabular data.

How do I make a div look like a table?

To make DIVs behave like TABLEs, you have to tell them to behave that way using the display property. The three key values that we'll be using are table , table-row and table-cell . Each element now behaves like it were part of a table.


1 Answers

Use tables for tabular data. The knock against tables has been when they've been used solely for layout purposes. They have their own purpose, and it's tabular data. Divs have no semantic meaning, and shouldn't be used for tabular data.

like image 177
kinakuta Avatar answered Oct 03 '22 18:10

kinakuta