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 5 of 5
  1. #1
    Regular Coder ajetrumpet's Avatar
    Join Date
    Jul 2009
    Location
    Iowa City, IA
    Posts
    407
    Thanks
    44
    Thanked 5 Times in 5 Posts

    table side by side

    all,

    is it possible to put two tables side by side? I'm trying to do this, with one 70% wide, and the other 25% wide. but in the code with dreamweaver, it automatically places them vertically on the page. can i fix this?

  • #2
    Regular Coder
    Join Date
    Jan 2006
    Posts
    568
    Thanks
    6
    Thanked 84 Times in 84 Posts
    If you are using tables for layout anyway you might as well have each table inside a cell in a container table, but it would be easier with divs and float:left.

    using tables:
    Code:
    <html>
    <head>
    <title></title>
    </head>
    <table width="100%">
    <tr>
    <td>
    <table width="70%">
    <tr>
    <td>
    col 1
    </td>
    </tr>
    </table>
    </td>
    
    <td>
    <table width="25%">
    <tr>
    <td>
    col 2
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </body>
    </html>
    using divs:
    Code:
    <html>
    <head>
    <title></title>
    </head>
    <body>
    <div style="float:left;width:70%">
    col 1
    </div>
    
    <div style="float:left;width:25%">
    col 2
    </div>
    </body>
    </html>

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,695
    Thanks
    22
    Thanked 1,832 Times in 1,816 Posts
    Hello ajetrumpet,
    Yes, like gusblake says, divs would be easier.
    Not sure what your building but did you know that tables are not for layout?

    Have a look at a basic 2 column layout using divs here.

    Hope that helps...
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #4
    Regular Coder ajetrumpet's Avatar
    Join Date
    Jul 2009
    Location
    Iowa City, IA
    Posts
    407
    Thanks
    44
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by Excavator View Post
    Hello ajetrumpet,
    Yes, like gusblake says, divs would be easier.
    Not sure what your building but did you know that tables are not for layout?

    Have a look at a basic 2 column layout using divs here.

    Hope that helps...
    I know that tables are not for layout, but I am not an HTML expert, and it takes a heck of a lot less time to get it right and compatible with mail servers this way in any other way. And I don't know that much about divs. I don't even know what they're for really, but I think it stands for "divider".

    Everyone says that tables are bad for layout, but I don't know of any other way to make good use of my time. I don't really understand what gusblake posted, but I'm trying to figure it out.

    And so you know, I'm trying to send a formatted newsletter. I got it done, but it took 2 hours, so there's gotta be an easier way to do this. I'm using a mass mailing software to send this, so I need the HTML code to paste into it. I'm formatting it in Dreamweaver. Got any other suggestions?

    Sorry for the ignorance!

  • #5
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,864
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    And so you know, I'm trying to send a formatted newsletter. I got it done, but it took 2 hours, so there's gotta be an easier way to do this. I'm using a mass mailing software to send this, so I need the HTML code to paste into it. I'm formatting it in Dreamweaver. Got any other suggestions?
    For newsletter? Then tables might be the best for the time being! Take a look at http://articles.sitepoint.com/articl...ide-html-email.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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