Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-21-2007, 08:41 PM   PM User | #1
Chiraku
New to the CF scene

 
Join Date: Jun 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Chiraku is an unknown quantity at this point
Div/CSS question

I have a table, and inside a

<tr><td width='71%'>Info to the left (want info to the right too)</td></tr>

in that same table, I want to put some info to the right, and I had managed to do so, but it always creates a space, like I pressed enter, then puts the info. Any help would be appreciated, thank you.
Chiraku is offline   Reply With Quote
Old 10-21-2007, 09:37 PM   PM User | #2
kitchenwench
New Coder

 
Join Date: Oct 2007
Posts: 11
Thanks: 3
Thanked 0 Times in 0 Posts
kitchenwench is an unknown quantity at this point
I'm not too sure what it is that you're attempting to do with the table, so I'm a bit hesitant in answering, but I'll give it a shot.

I'm assuming that you want two columns of text to appear within the cell? I'm still new to this, but I think the way to go about it would be nested divs inside the cell:

Code:
<div>
<div class="left">X</div>
<div class="right">X</div>
</div>
And in your CSS stylesheet, you'd have something roughly resembling the following

Code:
div .left {
     width:50%
     float:left;
}

div .right {
     width: 50%;
     float:left;
}
I'm still new to HTML/CSS, but I *think* that should give you what you need. One of the more experienced members here will probably be able to give you more help...

*EDIT:

Oh, I'm not sure...were you wanting two columns, one at 71% and the other at 29%? If so, remove the percent value from the cell's code and just replace the percentages in the CSS markup with the relevant amounts.

Last edited by kitchenwench; 10-21-2007 at 09:41 PM..
kitchenwench is offline   Reply With Quote
Old 10-24-2007, 12:18 AM   PM User | #3
bazz
Master Coder

 
Join Date: Apr 2003
Location: in my house
Posts: 5,211
Thanks: 39
Thanked 201 Times in 197 Posts
bazz will become famous soon enoughbazz will become famous soon enough
not sure I fully understand either but wouuld this work?

Code:
<tr><td>column 1 content</td><td>info you want to the right goes here.</td></tr>
I would suggest that you make the table a fixed width for the sake of consistency, though your specific layout may dictate otherwise.

bazz
bazz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:10 AM.


Advertisement
Log in to turn off these ads.