IBM developerWorks
           CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 14th, 2003, 11:03 AM
simonmaduro's Avatar
simonmaduro simonmaduro is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: USA
Posts: 140 simonmaduro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 5 m 4 sec
Reputation Power: 6
Send a message via Yahoo to simonmaduro
CSS: Table-less columns and wrapping

I just need my page to display a text header, then list one block at a time. Each block will consist of two columns. One column will display data titles, the other will display the data.

I thought I could accomplish this with CSS by nesting DIV tags, but it's not working the way I imagine it would.

Here's my PHP code followed by the pertinent CSS:

PHP Code:
while($row mysql_fetch_array($result)){

        echo 
"<div id=block>";

            echo 
"<div id=column>";

                echo 
"Time: <br>Date: <br> Location: ";

            echo 
"</div>";

            echo 
"<div id=column>";

                echo 
$row['time'] . "<br>";
                echo 
$row['date'] . "<br>";
                echo 
$row['location'];

            echo 
"</div>";

        echo 
"</div>";

    } 


CSS:

PHP Code:
#column {
    
floatleft;
    
line-height25px;
    
margin3px;
    }

#block {
        
border:1px solid #999;
    
margin:5px;
        
top:20px;
        
padding10px;
    } 


This is definitely a problem with me not knowing CSS well enough.

Reply With Quote
  #2  
Old August 14th, 2003, 11:12 AM
simonmaduro's Avatar
simonmaduro simonmaduro is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: USA
Posts: 140 simonmaduro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 5 m 4 sec
Reputation Power: 6
Send a message via Yahoo to simonmaduro
Hm. Threw a width: 100% into the block div... and that seems to do what I want it to.

Still an ugly hack?

Reply With Quote
  #3  
Old August 14th, 2003, 12:38 PM
Eclipce Eclipce is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Sep 2000
Posts: 763 Eclipce User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 5 h 29 m 25 sec
Reputation Power: 0
Well, for starters you need to change the id's to classes as you can not have more than one element with the same id.

Reply With Quote
  #4  
Old August 14th, 2003, 01:15 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,299 jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 1 h 54 m 17 sec
Reputation Power: 760
If you want #block to contain .column, you need to float it as well.
Code:
#block
  {
  float: left;
  top: 20px;
  border: 1px solid #999;
  margin: 5px;
  padding: 10px;
  }
.column /* column ids to classes in PHP */
  {
  clear: left;
  float: left;
  line-height: 25px;
  margin: 3px;
  }
__________________
# Jeremy

Explain your problem instead of asking how to do what you decided was the solution.

Reply With Quote
  #5  
Old August 14th, 2003, 03:03 PM
simonmaduro's Avatar
simonmaduro simonmaduro is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: USA
Posts: 140 simonmaduro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 5 m 4 sec
Reputation Power: 6
Send a message via Yahoo to simonmaduro
Even nicer. Thanks for the help Eclipce and jharnois.

Good luck with Lua, too.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS: Table-less columns and wrapping


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway