follmer
follmer

Reputation: 1078

Adding dynamic content to a webpage: using a table, divs, or lists?

When adding dynamic content to a webpage, is it better to add this by just adding a new row to a table, by adding a new div element, or adding a list element?

For example, if I wanted a posting of content to be added to a page when a user submits it, kind of like an ebay listing, or like reddit. When a user submits an "offer", the offer will be shown on the page, under all previous offers. What element would make the most sense to stick this information in?

Upvotes: 0

Views: 208

Answers (1)

ram dvash
ram dvash

Reputation: 190

It depends on the information. It doesn't matter if you are adding the content dynamically or writing static HTML - it's the same question.

You can get the answer by probing the type of the data:

  1. for list data (ordered or unordered) - use a list
  2. for tabular data - use table
  3. for other data - consider div (or other tags like section, footer, article etc.)

Upvotes: 1

Related Questions