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?
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 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 HTML tables SEO friendly? Yes they are SEO friendly if used correctly. Use them only for tabular data.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With