The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

What a terrible tutorial. Fancy recommending using tables. It will make the layout look like it was formed from Lego blocks rather than 3 columns with independedantly displayed content. And I dont see any need for a for loop.

What a terrible tutorial. Fancy recommending using tables. It will make the layout look like it was formed from Lego blocks rather than 3 columns with independedantly displayed content. And I dont see any need for a for loop.

Well, it depends on the actual data, but chances are great that data from a table is tabular data anyway. The way you wrote that makes me think that you think HTML tables are per se bad, which is a common misunderstanding in the current "CSS hype".
But tables aren't bad, if you place tabular data into them. Using absolutely meaningless div soup on the other hand is.

well, rajug the whole point was about not using table at all. and besides using while() or if() instead of for() doesn't change anything. lol.

Dan's is a typical table example. It follows the:

123
456
789

model. Obviously a while loop is needed to fetch the data, no one is disputing that. If you want 3 columns with content displayed vertically using a table things become a problem and the only way around this is to build the table asyncronously.

3 columns with divs (that read like a newspaper) is pretty easy but the most important part is dividing the content. There are two ways to do this, (1) put the same number of results in each column or (2) divide up the entire content based on its global volume. Option 2 is nicer as it allows all the columns to be completely filled irrespective of the length of any individual result. Have a look at the following example.

Note: Unlike tables the content in one column does not affect the vertical alignment of the content in the other columns. In this case the data is loaded into paragraphs and then split (as equally as possible) at the nearest paragraph boundry. If the new column didn't start with a heading after the division the most recent heading is reinserted.

This isn't really a question of right and wrong but more what output do you desire. If you want Lego blocks use a table; if you want a fluid newspaper style columns use this system.