Showing posts with label width. Show all posts
Showing posts with label width. Show all posts

Saturday, March 31, 2012

Table Scrolling Problem

Hi,
I have a table which I need to display within a div of a fixed width. The
length of the table exceeds the width of the div which is ok as I can make
the div scrollable. The problem that I have is that the cells in the table
must be a fixed with because they need to co-incide with another table which
is going to be in another scrolling div below.
The problem is if I restrict the with of the containing div to something
less than the with of the table. The table then attempts to crunch the
table width to the least width and thus reduces the table cell widths and
ignores the fixes widht size applied tot he style.
How can I get around this.the simple solution would be to
1. create transparent.gif with size 1x1 pixel
2. To the headers of columns add <img src="http://pics.10026.com/?src=transparent.gif" width=100
height=1>
This will keep your columns to be at least 100 pixels.
PS: There might be easier solutions with CSS. Mine is just a suggestion and
will work with any browser.
George.
"A Question" <q@.qs.com> wrote in message
news:eKEMiamPIHA.1208@.TK2MSFTNGP05.phx.gbl...
> Hi,
> I have a table which I need to display within a div of a fixed width. The
> length of the table exceeds the width of the div which is ok as I can
> make the div scrollable. The problem that I have is that the cells in the
> table must be a fixed with because they need to co-incide with another
> table which is going to be in another scrolling div below.
> The problem is if I restrict the with of the containing div to something
> less than the with of the table. The table then attempts to crunch the
> table width to the least width and thus reduces the table cell widths and
> ignores the fixes widht size applied tot he style.
> How can I get around this.
>
Hi, yes, its a possibility. I have also found that fixing the width of the
table acheives the same thing. Thanks for your help.
"George Ter-Saakov" <gt-nsp@.cardone.com> wrote in message
news:ux8U02mPIHA.292@.TK2MSFTNGP02.phx.gbl...
> the simple solution would be to
> 1. create transparent.gif with size 1x1 pixel
> 2. To the headers of columns add <img src="http://pics.10026.com/?src=transparent.gif" width=100
> height=1>
> This will keep your columns to be at least 100 pixels.
> PS: There might be easier solutions with CSS. Mine is just a suggestion
> and will work with any browser.
> George.
>
> "A Question" <q@.qs.com> wrote in message
> news:eKEMiamPIHA.1208@.TK2MSFTNGP05.phx.gbl...
>

Table Scrolling Problem

Hi,

I have a table which I need to display within a div of a fixed width. The
length of the table exceeds the width of the div which is ok as I can make
the div scrollable. The problem that I have is that the cells in the table
must be a fixed with because they need to co-incide with another table which
is going to be in another scrolling div below.

The problem is if I restrict the with of the containing div to something
less than the with of the table. The table then attempts to crunch the
table width to the least width and thus reduces the table cell widths and
ignores the fixes widht size applied tot he style.

How can I get around this.the simple solution would be to
1. create transparent.gif with size 1x1 pixel
2. To the headers of columns add <img src="http://pics.10026.com/?src=transparent.gif" width=100
height=1>

This will keep your columns to be at least 100 pixels.

PS: There might be easier solutions with CSS. Mine is just a suggestion and
will work with any browser.

George.

"A Question" <q@.qs.comwrote in message
news:eKEMiamPIHA.1208@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

Hi,
>
I have a table which I need to display within a div of a fixed width. The
length of the table exceeds the width of the div which is ok as I can
make the div scrollable. The problem that I have is that the cells in the
table must be a fixed with because they need to co-incide with another
table which is going to be in another scrolling div below.
>
The problem is if I restrict the with of the containing div to something
less than the with of the table. The table then attempts to crunch the
table width to the least width and thus reduces the table cell widths and
ignores the fixes widht size applied tot he style.
>
How can I get around this.
>
>


Hi, yes, its a possibility. I have also found that fixing the width of the
table acheives the same thing. Thanks for your help.

"George Ter-Saakov" <gt-nsp@.cardone.comwrote in message
news:ux8U02mPIHA.292@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

the simple solution would be to
1. create transparent.gif with size 1x1 pixel
2. To the headers of columns add <img src="http://pics.10026.com/?src=transparent.gif" width=100
height=1>
>
This will keep your columns to be at least 100 pixels.
>
PS: There might be easier solutions with CSS. Mine is just a suggestion
and will work with any browser.
>
George.
>
>
"A Question" <q@.qs.comwrote in message
news:eKEMiamPIHA.1208@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

>Hi,
>>
>I have a table which I need to display within a div of a fixed width. The
>length of the table exceeds the width of the div which is ok as I can
>make the div scrollable. The problem that I have is that the cells in the
>table must be a fixed with because they need to co-incide with another
>table which is going to be in another scrolling div below.
>>
>The problem is if I restrict the with of the containing div to something
>less than the with of the table. The table then attempts to crunch the
>table width to the least width and thus reduces the table cell widths and
>ignores the fixes widht size applied tot he style.
>>
>How can I get around this.
>>
>>


>
>

Table width, height setting is not working.

I am trying to divide a main page by 2 like 50% top and 50% bottom. So I tried like a code below but it doesn't divide by 50:50. It seems like 70:30. Does anybody know why it does this?
<asp:Table ID="Table1" runat="server" Width="100%" Height="100%" cellpadding="0" cellspacing="0"> <asp:TableRow ID="TableRow1" runat="server" Width="100%" Height="100%"> <asp:TableCell ID="TableCell1" runat="server" Width="100%" Height="50%">
      ...    </asp:TableCell>        <asp:TableCell ID="TableCell1" runat="server" Width="100%" Height="50%">
      ...    </asp:TableCell> <asp:TableRow><asp:table>
That was wrong code I got above. Here's the right one.
<html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:Table ID="Table1" runat="server" Width="100%" Height="100%" cellpadding="0" cellspacing="0"> <asp:TableRow ID="TableRow1" runat="server" Width="100%" Height="50%" > <asp:TableCell ID="TableCell1" runat="server" Width="100%" Height="100%" BackColor="red" > </asp:TableCell> </asp:TableRow> <asp:TableRow ID="TableRow2" runat="server" Width="100%" Height="50%"> <asp:TableCell ID="TableCell2" runat="server" Width="100%" Height="100%" BackColor="blue"> </asp:TableCell> </asp:TableRow> </asp:Table> </form></body></html>

Another question.

With the code above, even thought I specified the height to 50% to each, it only shows for one row not the whole page.

Please tell me how to divide a page into top half and bottom half so when I set background colors for each half, I can see the division by color.

 _____________________________________| || || || Red || || ||_____________________________________|| || || || Blue || || ||_____________________________________|To set like this.

Wednesday, March 28, 2012

TableCell Width

Hi,

Did someone know why this code does'nt work (The TableCell Width).
The cell don't have 600 and 150 like writed in width="600" and
width="150".

<asp:datagrid id="DataGrid1" runat="server"
AutoGenerateColumns="false" ShowHeader="false" ShowFooter="false">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:Table>
<asp:TableRow>
<asp:TableCell Width="600">
<%# container.dataitem("Service")%>
</asp:TableCell>
<asp:TableCell Width="150">
Price :
<%# databinder.eval(container.dataitem,"price","{0:c}")%>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagridSalut Andre,

La datagrid fait dj une table, et ton code tente d'en ajouter une. Tu
ferais mieux de te servir d'une Label.

The datagrid already creates a table, and your code is attempting to add
another. You'd do better using a Label:

<asp:datagrid id="DataGrid1" runat="server" AutoGenerateColumns="False"
ShowHeader="False">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:Label id="Label2" runat="server" Width="600px"></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:Label id="Label3" runat="server" Width="150px"></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid
Ken
Microsoft MVP [ASP.NET]
Toronto

"Andre" <lostman@.cablevision.qc.ca> wrote in message
news:uhcEiCq6DHA.3860@.tk2msftngp13.phx.gbl...
> Hi,
> Did someone know why this code does'nt work (The TableCell Width).
> The cell don't have 600 and 150 like writed in width="600" and
> width="150".
>
> <asp:datagrid id="DataGrid1" runat="server"
> AutoGenerateColumns="false" ShowHeader="false" ShowFooter="false">
> <Columns>
> <asp:TemplateColumn>
> <ItemTemplate>
> <asp:Table>
> <asp:TableRow>
> <asp:TableCell Width="600">
> <%# container.dataitem("Service")%>
> </asp:TableCell>
> <asp:TableCell Width="150">
> Price :
> <%# databinder.eval(container.dataitem,"price","{0:c}")%>
> </asp:TableCell>
> </asp:TableRow>
> </asp:Table>
> </ItemTemplate>
> </asp:TemplateColumn>
> </Columns>
> </asp:datagrid>
Une reponse en Francais, je n'en attendait pas autant ;o)))

L'ide des Label m'a sauver la vie.. de facon contourner :)
J'ai donc incorporer des Label dans ma table, donc mes Width fonctionne
parfaitement !!

Car avec seulement des Label la disposition est moin evidente, pour inscrire
les donnes sur des lignes diffrente par example..

Merci.

"Ken Cox [Microsoft MVP]" <BANSPAMken_cox@.sympatico.ca> wrote in message
news:uccNiys6DHA.2412@.TK2MSFTNGP09.phx.gbl...
> Salut Andre,
> La datagrid fait dj une table, et ton code tente d'en ajouter une. Tu
> ferais mieux de te servir d'une Label.
> The datagrid already creates a table, and your code is attempting to add
> another. You'd do better using a Label:
> <asp:datagrid id="DataGrid1" runat="server" AutoGenerateColumns="False"
> ShowHeader="False">
> <Columns>
> <asp:TemplateColumn>
> <ItemTemplate>
> <asp:Label id="Label2" runat="server" Width="600px"></asp:Label>
> </ItemTemplate>
> </asp:TemplateColumn>
> <asp:TemplateColumn>
> <ItemTemplate>
> <asp:Label id="Label3" runat="server" Width="150px"></asp:Label>
> </ItemTemplate>
> </asp:TemplateColumn>
> </Columns>
> </asp:datagrid>
> Ken
> Microsoft MVP [ASP.NET]
> Toronto
> "Andre" <lostman@.cablevision.qc.ca> wrote in message
> news:uhcEiCq6DHA.3860@.tk2msftngp13.phx.gbl...
> > Hi,
> > Did someone know why this code does'nt work (The TableCell Width).
> > The cell don't have 600 and 150 like writed in width="600" and
> > width="150".
> > <asp:datagrid id="DataGrid1" runat="server"
> > AutoGenerateColumns="false" ShowHeader="false" ShowFooter="false">
> > <Columns>
> > <asp:TemplateColumn>
> > <ItemTemplate>
> > <asp:Table>
> > <asp:TableRow>
> > <asp:TableCell Width="600">
> > <%# container.dataitem("Service")%>
> > </asp:TableCell>
> > <asp:TableCell Width="150">
> > Price :
> > <%# databinder.eval(container.dataitem,"price","{0:c}")%>
> > </asp:TableCell>
> > </asp:TableRow>
> > </asp:Table>
> > </ItemTemplate>
> > </asp:TemplateColumn>
> > </Columns>
> > </asp:datagrid
Salut Andr,

Je suis content que a fonctionne pour toi.

En passant, il y a un newsgroup francophone
(microsoft.public.fr.dotnet.aspnet) au cas ou tu en aurais besoin.

(Il est rare Toronto que je puisse sortir mon franais. Jai passe sept
ans Qubec [Ste-Foy].)

Ken
Toronto

I'm glad that works for you.

BTW, there's a francophone newsgroup (microsoft.public.fr.dotnet.aspnet) in
case you ever need it.

(I don't often get a chance in Toronto to use my French. I lived in Ste-Foy
for seven years.)

"Andre" <lostman@.cablevision.qc.ca> wrote in message
news:ereXSky6DHA.4012@.tk2msftngp13.phx.gbl...
> Une reponse en Francais, je n'en attendait pas autant ;o)))
> L'ide des Label m'a sauver la vie.. de facon contourner :)
> J'ai donc incorporer des Label dans ma table, donc mes Width fonctionne
> parfaitement !!
> Car avec seulement des Label la disposition est moin evidente, pour
> inscrire
> les donnes sur des lignes diffrente par example..
> Merci.
>
> "Ken Cox [Microsoft MVP]" <BANSPAMken_cox@.sympatico.ca> wrote in message
> news:uccNiys6DHA.2412@.TK2MSFTNGP09.phx.gbl...
>> Salut Andre,
>>
>> La datagrid fait dj une table, et ton code tente d'en ajouter une. Tu
>> ferais mieux de te servir d'une Label.
>>
>> The datagrid already creates a table, and your code is attempting to add
>> another. You'd do better using a Label:
>>
>> <asp:datagrid id="DataGrid1" runat="server"
>> AutoGenerateColumns="False"
>> ShowHeader="False">
>> <Columns>
>> <asp:TemplateColumn>
>> <ItemTemplate>
>> <asp:Label id="Label2" runat="server" Width="600px"></asp:Label>
>> </ItemTemplate>
>> </asp:TemplateColumn>
>> <asp:TemplateColumn>
>> <ItemTemplate>
>> <asp:Label id="Label3" runat="server" Width="150px"></asp:Label>
>> </ItemTemplate>
>> </asp:TemplateColumn>
>> </Columns>
>> </asp:datagrid>
>>
>> Ken
>> Microsoft MVP [ASP.NET]
>> Toronto
>>
>> "Andre" <lostman@.cablevision.qc.ca> wrote in message
>> news:uhcEiCq6DHA.3860@.tk2msftngp13.phx.gbl...
>> > Hi,
>>> > Did someone know why this code does'nt work (The TableCell Width).
>> > The cell don't have 600 and 150 like writed in width="600" and
>> > width="150".
>>>> > <asp:datagrid id="DataGrid1" runat="server"
>> > AutoGenerateColumns="false" ShowHeader="false" ShowFooter="false">
>> > <Columns>
>> > <asp:TemplateColumn>
>> > <ItemTemplate>
>> > <asp:Table>
>> > <asp:TableRow>
>> > <asp:TableCell Width="600">
>> > <%# container.dataitem("Service")%>
>> > </asp:TableCell>
>> > <asp:TableCell Width="150">
>> > Price :
>> > <%# databinder.eval(container.dataitem,"price","{0:c}")%>
>> > </asp:TableCell>
>> > </asp:TableRow>
>> > </asp:Table>
>> > </ItemTemplate>
>> > </asp:TemplateColumn>
>> > </Columns>
>> > </asp:datagrid>
>>>>

Tables and column sizes

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"> </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"> </td>
<td bgcolor="white" rowspan=3> </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.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/for...st10017013.aspx
http://www.eggheadcafe.com/articles...e_generator.asp
"Iams" <Iams@.hotmail> wrote in message
news:%23iY$CvuEFHA.2180@.TK2MSFTNGP12.phx.gbl...
> 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"> </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"> </td>
> <td bgcolor="white" rowspan=3> </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.
>
For the table set css rule table_layout:fixed; then specify the width for
the columns in the first row.
Eliyahu
"Iams" <Iams@.hotmail> wrote in message
news:%23iY$CvuEFHA.2180@.TK2MSFTNGP12.phx.gbl...
> 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"> </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"> </td>
> <td bgcolor="white" rowspan=3> </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.
>
Great ideas! Thanks so much!
"Robbe Morris [C# MVP]" <info@.turnkeytools.com> wrote in message
news:%23x78IcwEFHA.1924@.TK2MSFTNGP14.phx.gbl...
> 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/for...st10017013.aspx
> http://www.eggheadcafe.com/articles...e_generator.asp
>
> "Iams" <Iams@.hotmail> wrote in message
> news:%23iY$CvuEFHA.2180@.TK2MSFTNGP12.phx.gbl...
the
height="100%"
id=UcGeneral1
valign=top><uc1:ucDetails
>

Tables and column sizes

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"> </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"> </td>
<td bgcolor="white" rowspan=3> </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.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/for...st10017013.aspx
http://www.eggheadcafe.com/articles...e_generator.asp

"Iams" <Iams@.hotmail> wrote in message
news:%23iY$CvuEFHA.2180@.TK2MSFTNGP12.phx.gbl...
> 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"> </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"> </td>
> <td bgcolor="white" rowspan=3> </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.
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/for...st10017013.aspx
http://www.eggheadcafe.com/articles...e_generator.asp

"Iams" <Iams@.hotmail> wrote in message
news:%23iY$CvuEFHA.2180@.TK2MSFTNGP12.phx.gbl...
> 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"> </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"> </td>
> <td bgcolor="white" rowspan=3> </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.
For the table set css rule table_layout:fixed; then specify the width for
the columns in the first row.

Eliyahu

"Iams" <Iams@.hotmail> wrote in message
news:%23iY$CvuEFHA.2180@.TK2MSFTNGP12.phx.gbl...
> 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"> </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"> </td>
> <td bgcolor="white" rowspan=3> </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.
For the table set css rule table_layout:fixed; then specify the width for
the columns in the first row.

Eliyahu

"Iams" <Iams@.hotmail> wrote in message
news:%23iY$CvuEFHA.2180@.TK2MSFTNGP12.phx.gbl...
> 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"> </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"> </td>
> <td bgcolor="white" rowspan=3> </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.
Great ideas! Thanks so much!
"Robbe Morris [C# MVP]" <info@.turnkeytools.com> wrote in message
news:%23x78IcwEFHA.1924@.TK2MSFTNGP14.phx.gbl...
> 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/for...st10017013.aspx
> http://www.eggheadcafe.com/articles...e_generator.asp
>
> "Iams" <Iams@.hotmail> wrote in message
> news:%23iY$CvuEFHA.2180@.TK2MSFTNGP12.phx.gbl...
> > 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"> </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"> </td>
> > <td bgcolor="white" rowspan=3> </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.

Saturday, March 24, 2012

TabStrip + Multipage WebControl: Modify width?

Hello,
I use the TabStrip and the Multipage Webcontrol in my Web form. I have
three Tabs/Pages. However, I would like to define an area to the left
and to the right. Controls in these areas should always be visible.
Therefore I have put the TabStrip/Multipage inside a column of a HTML
table. The table consists of one row with three columns. But this
doesn't work at all. The table destroys the design of the PageViews,
but there should be space enough in the column to view the whole
PageViews.
As another approach I moved everything between a PageView into a User
control, one for each PageView. Then I included the User Controls. It
works fine, but as soon as I put the TabStrip/Multipage inside a HTML
column as above, it doesn't work either (which doesn't surprise me
since a User Control is little more than including).
As a final approach I replaced the MultiPage with three Panels. Each
of the panel should serve as a container for a PageView. Only one
panel should be visible at a time. I initialize each panel with its
User Control:
private void Page_Load(object sender, System.EventArgs e)
{
if(! IsPostBack)
{
devicePage = (Device)(LoadControl("Device.ascx") );
devicePage.ID = "devicePage";
Panel1.Controls.Add(devicePage);
pcbPage = (PCB)(LoadControl("PCB.ascx") );
pcbPage.ID = "pcbPage";
Panel2.Controls.Add(pcbPage);
boundCondPage = (BoundCond)(LoadControl("BoundCond.ascx") );
boundCondPage.ID = "boundCondPage";
Panel3.Controls.Add(boundCondPage);
tsHoriz.SelectedIndex = 0;
Panel1.Visible = true;
Panel2.Visible = false;
Panel3.Visible = false;
...
}
}
Also, I have set the AutoPostBack property of the TabStrip control to
true
and I have implemented a SelectedIndexChange handler for the TabStrip
control:
private void tsHoriz_SelectedIndexChange(object sender,
System.EventArgs e)
{
switch(tsHoriz.SelectedIndex)
{
case 0:
Panel1.Visible = true;
Panel2.Visible = false;
Panel3.Visible = false;
break;
case 1:
Panel1.Visible = false;
Panel2.Visible = true;
Panel3.Visible = false;
break;
case 2:
Panel1.Visible = false;
Panel2.Visible = false;
Panel3.Visible = true;
break;
}
...
But this doesn't work either. Only at first load does the first panel
appear with the appropriate User Control. As soon as I select another
tab, the User Control assigned with this tab isn't displayed. Also,
when I return to tab one the User Control assigned with the first
panel has disappeared too. It seems that the application forgets that
the Panels are populated with their corresponding User Controls. Note
that the User Control variables (i.e. devicePage, pcbPage, and
boundCondPage) are real member variables so they can't possibly go out
of scope.
So how can I get the functionality of a TabStrip + Multipage with
adjustible width?
(I have noticed that I *can* set the height of the Multipage. I can
have a button below the TabStrip/Multipage that is alway visible. I
guess that this is possible because I don't have to use a table to do
that: I simply can write the code for the button below the
TabStrip/Multipage code in the aspx file. But this is not what I want.
I want the button to appear right to the TabStrip/Multipage, but
always visible.)
Any help would be great.
Best regards
JohannesPlacing a tabstrip/pageview in a table should be no problem -- we have about
40 different pages
that do exactly the same thing without problems.
However, you need to be very careful that the HTML that is generated is accu
rate and legal; the
tabstrip/pageview and very sensitive to unclosed td/tr/table tags. You might
want to run the
tabstrip/pageview in downlevel mode to see if that makes a difference (I don
't recall how to do
that, but you can add config value to web.config to force it to run in downl
evel); you might try a
Mozilla browser to see if there's a difference (in Mozilla, there will be a
small gab on the
tabstrip above the pageview; this is because the HTML that the IE web contro
ls generates needs a bit
of tweak -- but the goal here is to solve the left/right padding).
When I've had problems with my tabstrip/pageviews; what I do is view the HTM
L source and then
cut/paste to a HTML edit (VS) and then reformat and make sure I have closed
all of the tags.
I don't know what your base browser requirements are; however if you just wa
nt to add some padding
around the tabstrip/pageivew look into using a <div style="padding-left: 10p
x">your-controls</div>.
Scott
"Johannes Eble" <skywalkerpackage@.hotmail.com> wrote in message
news:nm0h609iksp17to3m1c3vmq5dgbc9ohqp6@.
4ax.com...
> Hello,
> I use the TabStrip and the Multipage Webcontrol in my Web form. I have
> three Tabs/Pages. However, I would like to define an area to the left
> and to the right. Controls in these areas should always be visible.
> Therefore I have put the TabStrip/Multipage inside a column of a HTML
> table. The table consists of one row with three columns. But this
> doesn't work at all. The table destroys the design of the PageViews,
> but there should be space enough in the column to view the whole
> PageViews.
> As another approach I moved everything between a PageView into a User
> control, one for each PageView. Then I included the User Controls. It
> works fine, but as soon as I put the TabStrip/Multipage inside a HTML
> column as above, it doesn't work either (which doesn't surprise me
> since a User Control is little more than including).
> As a final approach I replaced the MultiPage with three Panels. Each
> of the panel should serve as a container for a PageView. Only one
> panel should be visible at a time. I initialize each panel with its
> User Control:
> private void Page_Load(object sender, System.EventArgs e)
> {
> if(! IsPostBack)
> {
> devicePage = (Device)(LoadControl("Device.ascx") );
> devicePage.ID = "devicePage";
> Panel1.Controls.Add(devicePage);
> pcbPage = (PCB)(LoadControl("PCB.ascx") );
> pcbPage.ID = "pcbPage";
> Panel2.Controls.Add(pcbPage);
> boundCondPage = (BoundCond)(LoadControl("BoundCond.ascx") );
> boundCondPage.ID = "boundCondPage";
> Panel3.Controls.Add(boundCondPage);
> tsHoriz.SelectedIndex = 0;
> Panel1.Visible = true;
> Panel2.Visible = false;
> Panel3.Visible = false;
>
> ...
> }
> }
> Also, I have set the AutoPostBack property of the TabStrip control to
> true
> and I have implemented a SelectedIndexChange handler for the TabStrip
> control:
> private void tsHoriz_SelectedIndexChange(object sender,
> System.EventArgs e)
> {
> switch(tsHoriz.SelectedIndex)
> {
> case 0:
> Panel1.Visible = true;
> Panel2.Visible = false;
> Panel3.Visible = false;
> break;
> case 1:
> Panel1.Visible = false;
> Panel2.Visible = true;
> Panel3.Visible = false;
> break;
> case 2:
> Panel1.Visible = false;
> Panel2.Visible = false;
> Panel3.Visible = true;
> break;
> }
> ...
>
> But this doesn't work either. Only at first load does the first panel
> appear with the appropriate User Control. As soon as I select another
> tab, the User Control assigned with this tab isn't displayed. Also,
> when I return to tab one the User Control assigned with the first
> panel has disappeared too. It seems that the application forgets that
> the Panels are populated with their corresponding User Controls. Note
> that the User Control variables (i.e. devicePage, pcbPage, and
> boundCondPage) are real member variables so they can't possibly go out
> of scope.
> So how can I get the functionality of a TabStrip + Multipage with
> adjustible width?
> (I have noticed that I *can* set the height of the Multipage. I can
> have a button below the TabStrip/Multipage that is alway visible. I
> guess that this is possible because I don't have to use a table to do
> that: I simply can write the code for the button below the
> TabStrip/Multipage code in the aspx file. But this is not what I want.
> I want the button to appear right to the TabStrip/Multipage, but
> always visible.)
>
> Any help would be great.
>
> Best regards
>
> Johannes
>
>
Hi Scott,
thanks very much for your answer.
You were probably right, i.e. some of the table tags were probably
garbled. I started a new web form. Then I placed the table, the
tabstrip and the multipage. Finally I placed the user controls one
after another. Now, everything seems to work fine, within the table.
Regards
Johannes

Tuesday, March 13, 2012

TD style gradient filter

I am trying to get a gradient filter on a table item.
I am using...
<td style="width: 309px; filter:
DXImageTransform.Microsoft.Gradient(EndColorStr=#c0cfe2,
StartColorStr=#ffffff, GradientType=0);">
hello</td>
I have tried changing the case, taking out single quotes and various other
things but it just doesn't work! All the examples I have seen say to use
"progid:DXImageTransform" but if I do this then the editor says the colon is
unexpected.
Any help much appreciated...
Best regards
Mark Baldwin> I have tried changing the case, taking out single quotes and various other
> things but it just doesn't work! All the examples I have seen say to use
> "progid:DXImageTransform" but if I do this then the editor says the colon
is
> unexpected.
> Any help much appreciated...
FWIW, I find it infinitely easier, and, obviously, more cross-browser
compatible to simply use a gradient image and assign it via CSS to the
background of your TD.
-Darrel
Mark,
That's correct, you have to prefix it with progid:. Just ignore the warning.
Eliyahu
"Mark" <swozz_@.hotmail.com> wrote in message
news:en2jwHDmFHA.3960@.TK2MSFTNGP12.phx.gbl...
> I am trying to get a gradient filter on a table item.
> I am using...
> <td style="width: 309px; filter:
> DXImageTransform.Microsoft.Gradient(EndColorStr=#c0cfe2,
> StartColorStr=#ffffff, GradientType=0);">
> hello</td>
> I have tried changing the case, taking out single quotes and various other
> things but it just doesn't work! All the examples I have seen say to use
> "progid:DXImageTransform" but if I do this then the editor says the colon
is
> unexpected.
> Any help much appreciated...
> Best regards
> Mark Baldwin
>

TD style gradient filter

I am trying to get a gradient filter on a table item.

I am using...

<td style="width: 309px; filter:
DXImageTransform.Microsoft.Gradient(EndColorStr=#c 0cfe2,
StartColorStr=#ffffff, GradientType=0);">
hello</td
I have tried changing the case, taking out single quotes and various other
things but it just doesn't work! All the examples I have seen say to use
"progid:DXImageTransform" but if I do this then the editor says the colon is
unexpected.

Any help much appreciated...

Best regards
Mark Baldwin> I have tried changing the case, taking out single quotes and various other
> things but it just doesn't work! All the examples I have seen say to use
> "progid:DXImageTransform" but if I do this then the editor says the colon
is
> unexpected.
> Any help much appreciated...

FWIW, I find it infinitely easier, and, obviously, more cross-browser
compatible to simply use a gradient image and assign it via CSS to the
background of your TD.

-Darrel
Mark,

That's correct, you have to prefix it with progid:. Just ignore the warning.

Eliyahu

"Mark" <swozz_@.hotmail.com> wrote in message
news:en2jwHDmFHA.3960@.TK2MSFTNGP12.phx.gbl...
> I am trying to get a gradient filter on a table item.
> I am using...
> <td style="width: 309px; filter:
> DXImageTransform.Microsoft.Gradient(EndColorStr=#c 0cfe2,
> StartColorStr=#ffffff, GradientType=0);">
> hello</td>
> I have tried changing the case, taking out single quotes and various other
> things but it just doesn't work! All the examples I have seen say to use
> "progid:DXImageTransform" but if I do this then the editor says the colon
is
> unexpected.
> Any help much appreciated...
> Best regards
> Mark Baldwin