Tables and column sizes

I

Iams

What do I have to do to get a column in a table to stay the same size no
matter what is in the other tables?

I've tried setting the width in px, in percentages, and nothing seems to
work; for example, the columns that are colored #cccccc I want to stay the
size of the menu control, which doesn't change.

However, if the column to the right of it, with the ucGeneral and ucDetails
controls, has nothing in it, or something very small, the #cccccc column
spreads out and I don't want it to do that. What's the secret.

<table runat=server bgcolor=white border=0 bordercolor=black height="100%"
width="100%" cellspacing=0 cellpadding=0 ID="Table1">
<tr height="10%" width="100%">
<td colspan=5><uc1:ucHeader id=UcHeader1
runat="server"></uc1:ucHeader></td>
</tr>
<tr valign=top>
<td bgcolor="#cccccc" rowspan=3 style="WIDTH: 10px">&nbsp;</td>
<td bgcolor="#cccccc" rowspan=3 style="WIDTH: 10px"><uc1:ucMenu
id=UcMenu1 runat="server"></uc1:ucMenu></td>
<td bgcolor="#cccccc" rowspan=3 style="WIDTH: 10px">&nbsp;</td>
<td bgcolor="white" rowspan=3>&nbsp;</td>
</tr>
<tr valign=top width="100%"><td valign=top><uc1:ucGeneral id=UcGeneral1
runat="server"></uc1:ucPointOfDiversionGeneral></td></tr>
<tr valign=top height="100%" width="100%"><td valign=top><uc1:ucDetails
id=UcDetails1 runat="server"></uc1:ucDetails></td>
</tr>
</table>


Thanks.
 
R

Robbe Morris [C# MVP]

In the column you want to be fixed, add the "nowrap" option in the TD tag.
For the column to the right, set it's width to 100%.

You could also try putting the contents of the fixed cell in a table of it's
own with a fixed size and aligned either center, left, or right. If the
right
column changes, it won't change how the nested table looks to the user.

--
2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.mastervb.net/home/ng/forumvbcode/post10017013.aspx
http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp
 
E

Eliyahu Goldin

For the table set css rule table_layout:fixed; then specify the width for
the columns in the first row.

Eliyahu
 
I

Iams

Great ideas! Thanks so much!
Robbe Morris said:
In the column you want to be fixed, add the "nowrap" option in the TD tag.
For the column to the right, set it's width to 100%.

You could also try putting the contents of the fixed cell in a table of it's
own with a fixed size and aligned either center, left, or right. If the
right
column changes, it won't change how the nested table looks to the user.

--
2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.mastervb.net/home/ng/forumvbcode/post10017013.aspx
http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top