+ Reply to Thread
Results 1 to 5 of 5

Thread: Table inside table

  1. #1
    wizeman's Avatar
    wizeman is offline Banned wizeman is an unknown quantity at this point
    Join Date
    Jun 2005
    Location
    At my houz
    Posts
    128

    Post Table inside table

    How It's Done

    Below is the code that created the table above. I have left the text black. The outer table's commands are purple and the inner table's commands are red so you can quickly tell them apart.

    <TABLE BORDER="3" CELLPADDING="10" CELLSPACING="10">
    <TD>

    <TABLE BORDER="3" CELLPADDING="3" CELLSPACING="3">
    <TD>2nd Table</TD>
    <TD>2nd Table</TD>
    <TR>
    <TD>2nd Table</TD>
    <TD>2nd Table</TD>
    </TR>
    </TABLE>

    </TD>
    <TD> The cell next to this one has a smaller table inside of it, a table inside a table.</TD>
    </TABLE>

    How It's Done

    First off, you should really know how to do a simple table before attempting to tackle this monster. See my table tutorial first. Then this will make a lot more sense.

    Now, for those of you already up to speed on tables, you can probably pick it up from the code how it's done. You simply make a point of ending every line with an end command. When you do a simple table, you really only need one </TR> and one </TD> command at the end of the table. But here, you need to end every line with its own </TD> and each <TR> with its own </TR>.
    A Tip

    When I do a table in a table, I tend to get a little confused on what goes with what. I create all the tables separately, making sure every section has its own end command. I create the tables that will go in the cells first. The last thing I make is the larger table. That way, I can create the large table and when I need to fill in the <TD> with a smaller table, I can just cut and paste it in. It also helps me to remember to follow the smaller table with a </TD> for the larger table's benefit. It's super easy to forget one and that can mess up the whole table scheme.

    Hope this helps...

  2. #2
    MicrotechXP's Avatar
    MicrotechXP is offline x10 Spammer MicrotechXP is an unknown quantity at this point
    Join Date
    Feb 2005
    Location
    USA,California
    Posts
    3,822

    Re: Table inside table

    Nice tutorial! That will help a lot of people!

  3. #3
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: Table inside table

    You can also use the colspan and rowspan attributes to control tables even more.

    Example:
    Code:
    <table width="200" align="right" border="1">
      <tr>
       <td colspan="2">Hows it going?</td>
       <td>Yes yes...</td>
     </tr>
     <tr>
       <td>ha</td>
       <td>ha</td>
       <td>ha</td>
     </tr>
    </table>
    This doesn't show with another table inside, but you could place a table anywheres between any "<td>" tags.

    (Sorry, I just had to say that... )

  4. #4
    n4tec's Avatar
    n4tec is offline Lord Of The Keys n4tec is an unknown quantity at this point
    Join Date
    Feb 2005
    Location
    GeT NOTICED via n4tec
    Posts
    1,656

    Talking Re: Table inside table

    that is a Nice tutorial... i recommend it to Newbies..
    .::: Regards, n4tec :::.


  5. #5
    TranceOperator's Avatar
    TranceOperator is offline x10 Sophmore TranceOperator is an unknown quantity at this point
    Join Date
    Mar 2005
    Location
    Louisville, KY
    Posts
    143

    Re: Table inside table

    It is a good one for newbies, unfortunately it doesn't conform to the w3c standards...but who cares? They say that now with tables you have to include <TH> and all of this other new crap...just so your site will be combatible with a PDA web browser :grin: who cares...But yeah, tables inside tables I've been doing that for a long time, real useful.

+ Reply to Thread

Similar Threads

  1. Table left, image right.
    By Fedlerner in forum Scripts & 3rd Party Apps
    Replies: 5
    Last Post: 08-20-2006, 12:48 PM
  2. Making a table in Mysql
    By Chatter911 in forum Free Hosting
    Replies: 7
    Last Post: 06-10-2006, 05:17 PM
  3. Outside access to MySQL table
    By Mentalist in forum Free Hosting
    Replies: 3
    Last Post: 09-28-2005, 11:51 AM
  4. [IPB] Contiguous Board Index
    By phenetic in forum Tutorials
    Replies: 5
    Last Post: 09-18-2005, 10:31 AM
  5. New Element In The Periodic Table
    By ironcross77 in forum Off Topic
    Replies: 1
    Last Post: 06-28-2005, 01:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers