Welcome to the MacNN Forums.

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.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Help? Create a two column table with div tags. Almost got it!

Help? Create a two column table with div tags. Almost got it!
Thread Tools
Dedicated MacNNer
Join Date: Jun 2001
Location: Xanadu Roller Palace, Chicago
Status: Offline
Reply With Quote
Oct 14, 2003, 02:49 AM
 
I'm just being anointed in the greatness of div tags and im going a bit crazy trying to figure this out


What i ultimately want is to make a two column table so all the blue underlined links are left aligned in the same place (Under "stats" + "where i'm at") like this:

But i get this:
http://68.72.104.99/html/pages/userprofile.html

The bold white headers won't force the 2nd and third lines of the links to wrap unless i specify a height in pixels which doesn't help because the lists will always change. I tried doing "height:100%;" but that didn't do anything.

Right now the second "Interests" section looks correct, but that is using a static value of 100px which won't work once the dynamic jsp stuff gets added.

Any advice is appreciated! Thanks.
(Last edited by + spiral +; Oct 14, 2003 at 03:06 AM. )
     
Registered User
Join Date: Jul 2003
Location: San Jose
Status: Offline
Reply With Quote
Oct 14, 2003, 03:59 AM
 
i don't know if this will fix your problem, but after taking a quick look at your site one thing that i noticed wrong is that you haven't closed your <.span> tag...

what you have:
[php]
<div ID="statcell">
<div STYLE="padding:8px;">
<div STYLE="float:left;width:65px;height:100%;">
<strong>Interests</strong>
</div>
<span class="statdatalinks"><a href="#">snippet...</a></div>
</div></div>
[/php]

what you need...
[php]
<div ID="statcell">
<div STYLE="padding:8px;">
<div STYLE="float:left;width:65px;height:100%;">
<strong>Interests</strong>
</div>
<span class="statdatalinks"><a href="#">snippet...</a></span>
</div></div>
[/php]
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Oct 14, 2003, 08:08 AM
 
I would suggest not using div tags for that. This is exactly the sort of thing that a table should be used for, if you're going for semantic markup. Use TH tags for the headers (Location, Hometown, and Interests) and TD tags for the data.

Semantic markup doesn't mean that tables get completely excised. Everything has its place, and that includes tables. What you have here looks like completely legitimate tabular data.

Alternatively, if you really don't want to use tables, you could use a definition list instead. Use DT for headers and DD for the data inside. Your CSS for such a solution will end up looking much the same as it does now. However, I recommend not bothering with that; this is one of those times when tables are a legitimate technique.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Dedicated MacNNer
Join Date: Jun 2001
Location: Xanadu Roller Palace, Chicago
Status: Offline
Reply With Quote
Oct 14, 2003, 10:51 AM
 
Thanks and thanks! The span tag was a just an oversigtht. I had gone back and forth with so many tags i missed one at 3am.

I used a small table like you suggested millenium. Works great and i can still wrap my divs around it. Thanks. I really appreciate your advice because i would have kept trying to do the div thing forever.

Thanks to both of you.
     
Addicted to MacNN
Join Date: Sep 2000
Status: Offline
Reply With Quote
Oct 14, 2003, 10:55 AM
 
Originally posted by Millennium:
I would suggest not using div tags for that. This is exactly the sort of thing that a table should be used for, if you're going for semantic markup. Use TH tags for the headers (Location, Hometown, and Interests) and TD tags for the data.

Semantic markup doesn't mean that tables get completely excised. Everything has its place, and that includes tables. What you have here looks like completely legitimate tabular data.

Alternatively, if you really don't want to use tables, you could use a definition list instead. Use DT for headers and DD for the data inside. Your CSS for such a solution will end up looking much the same as it does now. However, I recommend not bothering with that; this is one of those times when tables are a legitimate technique.


You also break older browsers. For no good reason.

Go for an extreme. Use Tables, and make the site compatible with all browsers.

Or go with XHTML, and completely irraticate older browsers using div tags and such.

I personally perfer tables and compatibility.

I don't keep my blog perfect to older browsers. Far from it, but it works, and it's readable.

In Netscape 4,my blog doesn't look pretty. But you can read everything. The content is still organized and understandable.

Yours doesn't even appear.

As much as I hate tables. If you want to have a good page, you have to use them. It's just a fact of the web. It's the most reliable, and consistant method of ensuring your content appears correctly in all browsers/platforms.
I always use protection when fscking my Mac... Do you?
     
Dedicated MacNNer
Join Date: Jun 2001
Location: Xanadu Roller Palace, Chicago
Status: Offline
Reply With Quote
Oct 14, 2003, 11:00 AM
 
Originally posted by macvillage.net:

Yours doesn't even appear.
Thanks. Sadly I dont have much choice as the rest of the site was built by someone else so im just creating framework around what exists.
     
Dedicated MacNNer
Join Date: Aug 2002
Status: Offline
Reply With Quote
Oct 14, 2003, 11:23 AM
 
Originally posted by macvillage.net:

Or go with XHTML, and completely irraticate older browsers using div tags and such.
I've seen CSS layouts that degrade quite nicely for older browsers. Why not just set it up that way. Supposedly 95% of browsers in use are CSS compliant anyway. Why not work towards the future instead of holding on to the past?
     
Dedicated MacNNer
Join Date: Jun 2001
Location: Xanadu Roller Palace, Chicago
Status: Offline
Reply With Quote
Oct 14, 2003, 11:27 AM
 
Could you send some links along if you think of them? I'd would love to see how people are using CSS elegantly. It is really powerful and i would like to do it "right".
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Oct 14, 2003, 12:14 PM
 
Originally posted by + spiral +:
Could you send some links along if you think of them? I'd would love to see how people are using CSS elegantly. It is really powerful and i would like to do it "right".
http://www.csszengarden.com
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Oct 14, 2003, 12:23 PM
 
Originally posted by macvillage.net:
You also break older browsers. For no good reason.
Myth. Actually, more like FUD.

One, it should be noted that table tags have never been deprecated, even in XHTML. You can have your hackjob layouts in XHTML -even XHTML Strict- if you really want.

Netscape 4 is dead. There are a few users still on it -mostly due to contractual obligations- but even these all have access to other browsers.

Better, instead, to ditch two browsers which together make up less marketshare than even Macs do, in favor of not only modern browsers but the many alternative devices which have begun to crop up.

But there's not even a need to ditch users of older browsers. Your bit about "not pretty , but organized and understandable" is still possible -indeed, it's even easier- with modern techniques.
In Netscape 4,my blog doesn't look pretty. But you can read everything. The content is still organized and understandable.

Yours doesn't even appear.
Actually, thanks for the heads-up. It had been a while since I last bothered to look in NS4. By tomorrow I'll have fixed that bug without using a hackjob layout.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Oct 14, 2003, 05:59 PM
 
You can catch missing tags with the W3.org HTML validator.

I made a script that does this:

http://www.monkeyfood.com/blog/archives/000021.html
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:16 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2