Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    New Coder
    Join Date
    Oct 2007
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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.

  • #3
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •