tables in HTML code help...?

so this is for a class in school. but. anyways. i have made three tables for my website, and i have to insert them all into one big table. how do i do this? and also, how do i center each indivudal table? thanks sooooooooooooooo much!!!!!!!!

Public Comments

  1. >http://www.w3schools.com Try there. They teach the best HTML. You will find it out there.
  2. To center a table you would include this in the table's tag <table align="center"> And if your tables have the same number of columns you can easily combine them by appending all of the code between the Table tags into one... For example <table> <tr> <td>Data 1</td> <td>Data 2</td> </tr> </table> <table> <tr> <td>Data 1.2</td> <td>Data 2.2</td> </tr> </table> Becomes <table> <tr> <td>Data 1</td> <td>Data 2</td> </tr> <tr> <td>Data 1.2</td> <td>Data 2.2</td> </tr> </table>
  3. The guy before me is right. However, you can also nest tables within tables, like this: <table> <tr> <td> <table> <tr> <td>Data...</td> </tr> </table> </td> ... and etc.
  4. Hi there, It depends on how you are wanting to lay it out, but here is one basic way of doing it that will create a three column layout. Of course you can change the padding, spacing, width, border, etc. of all of the tables to whatever you want or need them to be... <!-- Main Table --> <table width="780" cellpadding="0" cellspacing="0" border="0"> <tr> <!-- Left Column --> <td width="180" valign="top" align="center"> <!-- Table 1 of 3 --> <table width="180" cellpadding="0" cellspacing="0" border="0"> <tr> <td> Content for left column here. </td> </tr> </table> </td> <!-- Center Column --> <td width="420" valign="top" align="center"> <!-- Table 2 of 3 --> <table width="420" cellpadding="0" cellspacing="0" border="0"> <tr> <td> Content for center column here. </td> </tr> </table> </td> <!-- Right Column --> <td width="180" valign="top" align="center"> <!-- Table 3 of 3 --> <table width="180" cellpadding="0" cellspacing="0" border="0"> <tr> <td> Content for right column here. </td> </tr> </table> </td> </tr> </table> You mentioned wanting to center each individual table. The code above will center each table itself because of the align="center" in the <td> tags. However, that will not center the content in each of those tables in all browsers (it will in some but in others it will simply center the table). If you want to center the content in each of the 3 inner tables then add align="center" to each of the <td> tags in those 3 inner tables. Hope that helps, good luck with it!
Powered by Yahoo! Answers