0

I would like to create a read only grid on a webpage ( ie. tabular data with rows and columns [ data is fed from database ]. ) with sort capability, mouse hover and mouse click on the table cells.

For this , should I be using div tag or tag ? From what I hear is - to build a web page with left navigation , footer , header etc i.e a web page use div tags and when you need to display tabular data within page use table tag.

Offcourse it will be dynamic creation..

I am little confused , please advise.

user476566
  • 1,319
  • 3
  • 26
  • 42
  • If you use a table for your tabular data you get most of what you need out of the box (rows, cols, etc.) If you use divs you'll need to add your own logic to handle very basic column/row logic to keep things aligned. In either scenario you'll need to add logic for sorting/re-ordering as needed. – scunliffe Sep 17 '14 at 00:25
  • Please Read Here: [Difference between and table and div tag][1] [1]: http://stackoverflow.com/questions/4990819/table-based-layout-vs-div-based-layout – Nyi Ma Lay Win Lae Aye Sep 17 '14 at 00:31
  • As you state in your question you require to display Tabular data, this is what tables were designed for. The big negativity towards using Tables in websites come from the olden days when everyone used them to lay out entire web pages. Now there seems to be a stigma against them stemming from that reason, but if you have tabular data I can't imagine why you would put it any where else. – Doug Sep 17 '14 at 00:34

1 Answers1

0

In general it is recommended to use semantic tags - that are tags with a contextual meaning.

Though table, thead, tbody, tfoot, tr, td, th and caption are more than just semantic tags as they have their own display properties and structual behavior they have as well a semantic meaning.

This allows interpretation of contents beside a visual browser - e.g. for audio readers etc..

Additional information:

http://en.wikipedia.org/wiki/Semantic_HTML

http://planetoftheweb.com/components/promos.php?id=543

http://www.w3schools.com/html/html5_semantic_elements.asp

conceptdeluxe
  • 3,753
  • 3
  • 25
  • 29