Link to home
Start Free TrialLog in
Avatar of cscott57
cscott57

asked on

different sections in table

Okay, I hope I can explain this. I have the following table on my site:
<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0" BGCOLOR="#00CED1">
<TR>
<TD>
  <TABLE CELLSPACING="1" CELLPADDING="3" BORDER="0">
  <TR>
<CAPTION></CAPTION>
<TD ALIGN="center></TD></tr><TR>
<TD ALIGN="center">
</TD></tr>

</TD>
  </TR>
  </TABLE>
</TD>
</TR>
</TABLE>
This gives me a small box in the middle of the page with different info in it. Now what I would like to do is to put one thing on the left of this box and another on the right. I can't figure out how to do this though. Anyone?
thanks,
Scott
Avatar of chewymon
chewymon


<TABLE width="95%">
<TR>
<TD width="33%">Your info here</TD>
<TD>
<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0" BGCOLOR="#00CED1">
<TR>
<TD width="34%">
  <TABLE CELLSPACING="1" CELLPADDING="3" BORDER="0">
  <TR>
<CAPTION></CAPTION>
<TD ALIGN="center></TD></tr><TR>
<TD ALIGN="center">
</TD></tr>

</TD>
  </TR>
  </TABLE>
</TD>
</TR>
</TABLE>
</TD>
<TD width="33%">Other info here</TD></TR></TABLE>

This puts your table in the center with a cell on each side of it for other uses.  Depending on your materisl, you might not have to set the cell widths.
Avatar of cscott57

ASKER

That is great. I just have one more question. The two things on the sides appear too close to my middle onject. I would like them closer to the borders. I assume this is the cell width you wrote about. I tried to fiddle with these but it did not do it. Any clues?
thanks,
Scott
The cell width just sets the width of the area.  If the objects do not take up the whole width of the cell, they can be positioned like so.

<TD WIDTH="33%" ALIGN="left">
for the left side and
<TD WIDTH="33%" ALIGN="right">
for the right side.  You can also narrow the center cell if you wish.  The widths of the three cells must equal 100%.

You can actually do even more.
<TD WIDTH="33%" ALIGN="left" VALIGN="top">
will put it in the top, left cormer of the cell and

<TD WIDTH="33%" ALIGN="right" VALIGN="bottom">
will put it in the lower right hand corner of the cell.

Also remember you can set the cellspacing and cell padding in any <TD> tag.
Works like a charm. thank you for the very thorough explanation.

Scott
Hey! Don't forget to give him his points! :)
ASKER CERTIFIED SOLUTION
Avatar of chewymon
chewymon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial