Jump to content

aligning tables


pneudralics

Recommended Posts

Well a simple table that would have a header and then a navigation column and a main content area, that would look like:

[code]
+----------------+
|                |
+----+-----------+
|    |           |
|    |           |
|    |           |
|    |           |
|    |           |
|    |           |
|    |           |
+----+-----------+[/code]

You would use the code:

[code]<table width="760" border="0" cellpadding="5" cellspacing="0">
    <tr>
        <td colspan="2">
            Header content here
        </td>
    </tr>
    <tr>
        <td width="25%">
            Navigation here
        </td>
        <td width="75%">
            Main content
        </td>
    </tr>
</table>[/code]
Link to comment
https://forums.phpfreaks.com/topic/5625-aligning-tables/#findComment-20309
Share on other sites

  • 5 weeks later...
If you want a column on the left and the right use something like this:
[code]<table width="100%" border="1">
  <tr><td colspan="3">This is the title bar</td></tr>
  <tr>
    <td valign="top">LEFT COLUMN</td>
    <td valign="top">MIDDLE COLUMN</td>
    <td valign="top">RIGHT COLUMN</td>
  </tr>
</table>[/code]
Change border to 0 when you are happy. Having [b]valign="top"[/b] makes sure that the contents of each column are aligned to the top.

Just replace the above text showing each column with more table declarations, hope its what you were asking for :)
Link to comment
https://forums.phpfreaks.com/topic/5625-aligning-tables/#findComment-29906
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.