Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Very basic table question

Status
Not open for further replies.

johnnygeo

Programmer
Apr 23, 2003
125
US
I'm having trouble sizing the cells of my table right. The table should have three columns. The first and third columns are sidebars that should each have a cell just tall enough for one line of text, and an expandable-height cell below it. The central column is the body and will just have one cell that spans the two rows.

The problem I'm having is that as the body grows, the Sidebar titles keep expanding. I want them to stay one line high and have the sidebar contents expand.

<table width=100%>
<tr>
<td width=20%>Sidebar1</td>
<td rowspan=2 width=*>
Body<br><br><br>
Body<br><br><br>
Body<br><br><br>
</td>
<td width=20%>Sidebar2</td>
</tr>
<tr>
<td>Sidebar1<br>Contents</td>
<td>Sidebar2<br>Contents</td>
</tr>
</table>
 
Because they belong to the same table is very hard to acomplish that. What I usually do is create another table and have the property valign=&quot;top&quot; to keep it on top no matter what happens with the contents.

<table width=100%>
<tr>
<td width=20% valign=&quot;top&quot;> <table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr>
<td>Sidebar1 </td>
</tr>
<tr>
<td><p>Sidebar 1 Contents</p>
<p>&nbsp;</p></td>
</tr>
</table></td>
<td width=*> <p>Body<br>
<br>
<br>
Body<br>
<br>
<br>
Body</p>
<br>
</p></td>
<td width=20% valign=&quot;top&quot;> <table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr>
<td>Sidebar2</td>
</tr>
<tr>
<td><p>Sidebar 2 Contents</p>
<p>&nbsp;</p></td>
</tr>
</table></td>
</tr>
</table>


goodluck .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top