Hey folks, I am putting together a large menu and really can't work out what is better. Should I make it tables or div's? Personally I hate tables but as the menu is relatively large I am not sure what is better practice. What is the CORRECT way to produce a large menu?
hmm.. well div is the better way. you can use a accordion menu. thats easy to make and looks elegant too
as Menu is semantically a list, so actually it would be better if you use list ( <ul> or <ol> ) for that.
the correct way to present a list would be like so: <ul> <li>link</li> <li>link</li> <li>link</li> </ul>
This way once the css is taken away the links will appear as bullet points which you can have totall control over the styling. This way search engines digest the information better aswell.
Those saying use a list are spot on - whenever you are putting tags around content, you should be asking yourself "What is this content?" If it's a paragraph of flow text, put it in a paragraph - if it's text that is not part of content flow, do NOT use a paragraph. If it's a content image, use an image tag, if it's a presentational image like a border, background, or image instead of text it doesn't even belong in the markup! If it's a heading, use a heading tag, NOT bold and font or a classed div... If the data is rows and columns where the rows are related and the columns are related, that's what a table is for. If it's not tabular data, don't use a table. (conversely don't abuse a ordered list and a assload of div's for obviously tabular data like many forum skinners seem to be doing right now!) ... and what is a menu but a list of choices? List? We have tags for that! Remember, your HTML should say what things ARE, NOT how they are going to appear. Appearance is CSS' job... unless of course you're still pretending it's 1997.