Issue
I want to render a profile user container that contains a list of labels and their associated values.
Here is an excerpt of information and layout I'd like to display:
First Name.......MyName
Age...................MyAge
email................MyEmail
I know that there are tons of examples available but the problem is that it seems that there is no commonly accepted solution.
So far I have seen the following usage :
- Table with markup (and < tr >,< td >...)
- Unordered list with < ul > markup (and < li >, < div >...)
- Regular markups with < h1 >,< h2 >...< p >
- Definition List with < DL >, < DT > and < DD >
- < label >...?
What is the most semantically correct? What is the easiest to display (in a 2-columns layout)? What do you advise me to use and for what reasons?
(html/css code snippets are more than welcomed)
Solution
Wow. We really have scared everyone off with the “Table layouts are evil! Use CSS!” stuff, haven't we?
A table — with <th>
for the labels and <td>
for the values — is perfectly applicable to this kind of content, gives you the rendering you want, and is at least as semantically correct as a definition list, arguably more so. Either are preferable to semantics-free divs.
Answered By - bobince
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.