www.webdeveloper.com
Results 1 to 7 of 7

Thread: howto put HTML tables side by side

  1. #1
    Join Date
    Nov 2004
    Location
    xxxyyy
    Posts
    357

    howto put HTML tables side by side

    How do I put two HTML tables side by side, centered on the page.(little gap in between)

  2. #2
    Join Date
    Dec 2007
    Location
    Kelowna, BC
    Posts
    100
    Hi cofactor,

    Should be easily achieved, although some of the pros may have better methods than this example:

    <div align="center">
    <TABLE BORDER="1" WIDTH="500">
    <TR>
    <TD WIDTH=250>
    <TABLE BORDER="1" WIDTH="250">
    <TR>
    <TD align="middle">
    This is in our first table!
    </TD>
    </TR>
    </TABLE>
    </TD>
    <TD WIDTH="250">
    <TABLE BORDER="1">
    <TR>
    <TD align="middle" WIDTH="250">
    And this is in the second table!
    </TD>
    </TR>
    </TABLE>
    </TD>
    </TR>
    </TABLE>
    </div>


    Hope this helps,
    All the best,
    Cal
    Visiting or Relocating to the Okanagan Valley...
    http://www.okanaganforum.com

  3. #3
    Join Date
    Jun 2006
    Location
    Boston, MA
    Posts
    383
    heres another method:

    HTML Code:
    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <div style="width:610px;height:auto;position:relative;">
    <table width="300" border="0" align="left" cellpadding="0" cellspacing="0" style="margin-right:10px;">
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
    
    <table width="300" border="0" align="left" cellpadding="0" cellspacing="0">
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
    </div>
    </body>
    </html>
    "Problems cannot be solved by the same level of thinking that created them.

  4. #4
    Join Date
    Jul 2012
    Location
    london
    Posts
    16
    Make a master table, divide it in 3 blocks and adjust you two tables in left and right blocks.
    maintain center block according to the spacing you require.

  5. #5
    Join Date
    Aug 2012
    Posts
    3
    You can make the table to float by using float in css or else you can use inline function too

  6. #6
    Join Date
    Aug 2012
    Posts
    6

    Arranging table

    All other ideas are really appreciable...I think you first arrange 2 divs side by side like you want..and then in each div put the tables..

  7. #7
    Join Date
    Aug 2012
    Location
    Tucson
    Posts
    45
    Quote Originally Posted by roma123 View Post
    All other ideas are really appreciable...I think you first arrange 2 divs side by side like you want..and then in each div put the tables..
    Here is one possible solution:

    Flexible "Float Box Left" Layout

    This method produces a flexible layout -- fills the screen at different resolutions.
    And, especially for cofactor - check the source code and feel free to use any markup if you wish.

    HTML 5 Polyglot (html+xhtml) page

    P

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles