Showing posts with label column. Show all posts
Showing posts with label column. Show all posts

Saturday, March 31, 2012

Table Sizing

Hi All,

I have a table with three columns but I want to make the left had column a fixed width?

Is this possible?

For example if the table is 300 pixels wide

I want column 1 to be 50 pixlels and column 2 & 3 125 pixles each!

anyone any ideas?

cheers

Tonyspecify width in pixels for first column, then percentage for other 2


<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50"> </td>
<td width="33%"> </td>
<td width="33%"> </td>
</tr>
</table
or size everything

<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50"> </td>
<td width="125"> </td>
<td width="125"> </td>
</tr>
</table>

Is that what you meant ??
col1:
width = 15%

col2 and col3
width = 42%

is that what you ment?

otherwise if you wanted col1 to always be 50 pixels

col1:
width = 50

withis the second column nest a table with two columns of width = %50

try that and tell me how it works

table server control -- make column invisible

I have a table server control (System.Web.UI.WebControls.Table) on my form
that has three columns. Sometimes I need the second column to be invisible,
sometimes the third. How can I set a column to be invisible in code? There
appears to not be a programmatic way to work with columns in the way that
there is rows.

Thanks.

--SusanI don't think there a Column Visible property for the WebControls.Table object. So you may have to handle this on your own

For example
foreach(TableRow tr in myTable.Rows

tr.Cells[yourcolumnindex].Visible = false

HTH
Suresh

-- Susan Geller wrote: --

I have a table server control (System.Web.UI.WebControls.Table) on my for
that has three columns. Sometimes I need the second column to be invisible
sometimes the third. How can I set a column to be invisible in code? Ther
appears to not be a programmatic way to work with columns in the way tha
there is rows

Thanks

--Susa

Wednesday, March 28, 2012

tables ;-(

Hello,

I am trying to stop some behavior going on with a table. I have been
using Visual Studio C# 2005.

Basically, the table has certain column widths to start out with. When
data is added to it (and the size of the column is too small), the data
(in this case text) in the column wraps ;-/

How can I keep the data from wrapping? What would be nice is if no
wrapping to place at all and to just be able to adjust the size of
columns manually. You know - where you place the cursor on the boundary
of the column, the cursor changes and then you can lengthen or shorten
the width of the column in order to see more (or less) data.

So, in a nutshell, I would like for the column widths (as well as the
table length and width) to remain the same size as did from the start.
Adjustment of column widths would take place only when using the mouse
;-)

How can I do this?

TIAIm guessing here, but if you think about what the system would need to do in
order to assess the column width Its unlikely that it is going to do it for
you.

In order to assess the column with of any column, one would have to loop
through each cell and get the context, font and size and then measure this
graphically; For each iteration, one would need to adjust the column width
for each lager than previous cell until the end were reached.

If there is no automatic way of doing this then you would have to do this
manually with code.

Other comments ?

Mr N.

"milkyway" <d0mufasa@.hotmail.com> wrote in message
news:1127803098.346775.281760@.z14g2000cwz.googlegr oups.com...
> Hello,
> I am trying to stop some behavior going on with a table. I have been
> using Visual Studio C# 2005.
> Basically, the table has certain column widths to start out with. When
> data is added to it (and the size of the column is too small), the data
> (in this case text) in the column wraps ;-/
> How can I keep the data from wrapping? What would be nice is if no
> wrapping to place at all and to just be able to adjust the size of
> columns manually. You know - where you place the cursor on the boundary
> of the column, the cursor changes and then you can lengthen or shorten
> the width of the column in order to see more (or less) data.
> So, in a nutshell, I would like for the column widths (as well as the
> table length and width) to remain the same size as did from the start.
> Adjustment of column widths would take place only when using the mouse
> ;-)
> How can I do this?
> TIA
Try style rule table-layout:fixed;

Eliyahu

"milkyway" <d0mufasa@.hotmail.com> wrote in message
news:1127803098.346775.281760@.z14g2000cwz.googlegr oups.com...
> Hello,
> I am trying to stop some behavior going on with a table. I have been
> using Visual Studio C# 2005.
> Basically, the table has certain column widths to start out with. When
> data is added to it (and the size of the column is too small), the data
> (in this case text) in the column wraps ;-/
> How can I keep the data from wrapping? What would be nice is if no
> wrapping to place at all and to just be able to adjust the size of
> columns manually. You know - where you place the cursor on the boundary
> of the column, the cursor changes and then you can lengthen or shorten
> the width of the column in order to see more (or less) data.
> So, in a nutshell, I would like for the column widths (as well as the
> table length and width) to remain the same size as did from the start.
> Adjustment of column widths would take place only when using the mouse
> ;-)
> How can I do this?
> TIA
milkyway wrote:
> Hello,
> I am trying to stop some behavior going on with a table. I have been
> using Visual Studio C# 2005.
> Basically, the table has certain column widths to start out with. When
> data is added to it (and the size of the column is too small), the
> data (in this case text) in the column wraps ;-/
> How can I keep the data from wrapping? What would be nice is if no
> wrapping to place at all and to just be able to adjust the size of
> columns manually. You know - where you place the cursor on the
> boundary of the column, the cursor changes and then you can lengthen
> or shorten the width of the column in order to see more (or less)
> data.
> So, in a nutshell, I would like for the column widths (as well as the
> table length and width) to remain the same size as did from the start.
> Adjustment of column widths would take place only when using the mouse
> ;-)
> How can I do this?
> TIA

Watch out for a too-exact layout, one that is "perfect" on your development machine.
A user might use a different browser, have different installed fonts or uses
by default a font with a different size -> gone is your careful layout!

Hans Kesting
set absolute width and overflow style for each td's content, so it can honor
the width. you would need to write client code to resize the table column
widths (adjust the content widths).

<table border=1>
<tr>
<td nowrap><div style="width:40;overflow:hidden">this fits</div></td>
<td nowrap><div style="width:40;overflow:hidden">this xxxxxxxxxxxxxxxxx
doesn't fit</div></td>
</tr>
</table
-- bruce (sqlwork.com)

"milkyway" <d0mufasa@.hotmail.com> wrote in message
news:1127803098.346775.281760@.z14g2000cwz.googlegr oups.com...
> Hello,
> I am trying to stop some behavior going on with a table. I have been
> using Visual Studio C# 2005.
> Basically, the table has certain column widths to start out with. When
> data is added to it (and the size of the column is too small), the data
> (in this case text) in the column wraps ;-/
> How can I keep the data from wrapping? What would be nice is if no
> wrapping to place at all and to just be able to adjust the size of
> columns manually. You know - where you place the cursor on the boundary
> of the column, the cursor changes and then you can lengthen or shorten
> the width of the column in order to see more (or less) data.
> So, in a nutshell, I would like for the column widths (as well as the
> table length and width) to remain the same size as did from the start.
> Adjustment of column widths would take place only when using the mouse
> ;-)
> How can I do this?
> TIA
Thanks to all for the responses ;-)

Bruce Barker wrote:
> set absolute width and overflow style for each td's content, so it can honor
> the width. you would need to write client code to resize the table column
> widths (adjust the content widths).
How would one approach the writing of clinet code to support the
widths? Is there any sample code available?

> "milkyway" <d0mufasa@.hotmail.com> wrote in message
> news:1127803098.346775.281760@.z14g2000cwz.googlegr oups.com...
> > Hello,
> > I am trying to stop some behavior going on with a table. I have been
> > using Visual Studio C# 2005.
> > Basically, the table has certain column widths to start out with. When
> > data is added to it (and the size of the column is too small), the data
> > (in this case text) in the column wraps ;-/
> > How can I keep the data from wrapping? What would be nice is if no
> > wrapping to place at all and to just be able to adjust the size of
> > columns manually. You know - where you place the cursor on the boundary
> > of the column, the cursor changes and then you can lengthen or shorten
> > the width of the column in order to see more (or less) data.
> > So, in a nutshell, I would like for the column widths (as well as the
> > table length and width) to remain the same size as did from the start.
> > Adjustment of column widths would take place only when using the mouse
> > ;-)
> > How can I do this?
> > TIA
You could easily ammend this code to suit your table control.

http://www.trainingon.net/Articles/TIP0005.htm

HTH

"milkyway" <d0mufasa@.hotmail.com> wrote in message
news:1127968780.006696.275920@.g43g2000cwa.googlegr oups.com...
> Thanks to all for the responses ;-)
> Bruce Barker wrote:
>> set absolute width and overflow style for each td's content, so it can
>> honor
>> the width. you would need to write client code to resize the table column
>> widths (adjust the content widths).
>>
> How would one approach the writing of clinet code to support the
> widths? Is there any sample code available?
>
>> "milkyway" <d0mufasa@.hotmail.com> wrote in message
>> news:1127803098.346775.281760@.z14g2000cwz.googlegr oups.com...
>> > Hello,
>>> > I am trying to stop some behavior going on with a table. I have been
>> > using Visual Studio C# 2005.
>>> > Basically, the table has certain column widths to start out with. When
>> > data is added to it (and the size of the column is too small), the data
>> > (in this case text) in the column wraps ;-/
>>> > How can I keep the data from wrapping? What would be nice is if no
>> > wrapping to place at all and to just be able to adjust the size of
>> > columns manually. You know - where you place the cursor on the boundary
>> > of the column, the cursor changes and then you can lengthen or shorten
>> > the width of the column in order to see more (or less) data.
>>> > So, in a nutshell, I would like for the column widths (as well as the
>> > table length and width) to remain the same size as did from the start.
>> > Adjustment of column widths would take place only when using the mouse
>> > ;-)
>>> > How can I do this?
>>> > TIA
>
Thanks again - will try it out
Thanks again - will try it out
Put <nobr>text here</nobr> around your text.

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available

"Mr Newbie" <here@.now.com> wrote in message
news:e1qRrI0wFHA.664@.tk2msftngp13.phx.gbl...
> Im guessing here, but if you think about what the system would need to do
> in order to assess the column width Its unlikely that it is going to do it
> for you.
> In order to assess the column with of any column, one would have to loop
> through each cell and get the context, font and size and then measure this
> graphically; For each iteration, one would need to adjust the column width
> for each lager than previous cell until the end were reached.
> If there is no automatic way of doing this then you would have to do this
> manually with code.
> Other comments ?
> Mr N.
>
> "milkyway" <d0mufasa@.hotmail.com> wrote in message
> news:1127803098.346775.281760@.z14g2000cwz.googlegr oups.com...
>> Hello,
>>
>> I am trying to stop some behavior going on with a table. I have been
>> using Visual Studio C# 2005.
>>
>> Basically, the table has certain column widths to start out with. When
>> data is added to it (and the size of the column is too small), the data
>> (in this case text) in the column wraps ;-/
>>
>> How can I keep the data from wrapping? What would be nice is if no
>> wrapping to place at all and to just be able to adjust the size of
>> columns manually. You know - where you place the cursor on the boundary
>> of the column, the cursor changes and then you can lengthen or shorten
>> the width of the column in order to see more (or less) data.
>>
>> So, in a nutshell, I would like for the column widths (as well as the
>> table length and width) to remain the same size as did from the start.
>> Adjustment of column widths would take place only when using the mouse
>> ;-)
>>
>> How can I do this?
>>
>> TIA
>>

tables & rows & columns

I have a table that doesn't line up the way I want it to. I have 6 rows and
3 columns. The 3rd column spans the 6 rows and contains a grid. If the
data in the grid has more than 6 rows of data, the other rows spread out
vertically, as if there is extra space in there. I don't want that to
happen, I want the 6 rows to be together as if there is no space between
then. I have tried using height, valign, using a set height and using a
percentage height and it doesn't work. How can I make the 6 rows on the
left align all the way to the top?
<table borderColor=red cellSpacing=0 cellPadding=0 width="100%" border=1
runat="server" ID="Table1">
<tr vAlign=top colspan=4><td> </td></tr>
<tr vAlign=top>
<td valign=top style="HEIGHT: 15px" align=left width=100>Col 1</td>
<td vAlign=top height=5>Col 2</td>
<td align=right rowspan=6>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col
3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col
3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br></td>
<td align=left rowspan=6>Col 4</td></tr>
<tr valign=top height=1>
<td valign=top>col 1</td>
<td valign=top>col 2</td>
</tr>
<tr valign=top height=1>
<td valign=top>col 1</td>
<td valign=top>col 2</td>
</tr>
<tr valign=top height=1>
<td valign=top>col 1</td>
<td valign=top>col 2</td>
</tr>
<tr valign=top height=1>
<td valign=top>col 1</td>
<td valign=top>col 2</td>
</tr>
<tr valign=top>
<td valign=top>col 1</td>
<td valign=top>col 2</td>
</tr>
</table>Maybe I didn't really get your question, but I do not see a grid in the
3rd column.
But did you try to put another table into one cell? That often works.
Remy Blaettler
www.collaboral.com

tables & rows & columns

I have a table that doesn't line up the way I want it to. I have 6 rows and
3 columns. The 3rd column spans the 6 rows and contains a grid. If the
data in the grid has more than 6 rows of data, the other rows spread out
vertically, as if there is extra space in there. I don't want that to
happen, I want the 6 rows to be together as if there is no space between
then. I have tried using height, valign, using a set height and using a
percentage height and it doesn't work. How can I make the 6 rows on the
left align all the way to the top?

<table borderColor=red cellSpacing=0 cellPadding=0 width="100%" border=1
runat="server" ID="Table1">
<tr vAlign=top colspan=4><td> </td></tr
<tr vAlign=top>
<td valign=top style="HEIGHT: 15px" align=left width=100>Col 1</td>
<td vAlign=top height=5>Col 2</td>
<td align=right rowspan=6>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col
3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col
3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br>Col 3<br></td>
<td align=left rowspan=6>Col 4</td></tr>
<tr valign=top height=1>
<td valign=top>col 1</td>
<td valign=top>col 2</td>
</tr>
<tr valign=top height=1>
<td valign=top>col 1</td>
<td valign=top>col 2</td>
</tr>
<tr valign=top height=1>
<td valign=top>col 1</td>
<td valign=top>col 2</td>
</tr>
<tr valign=top height=1>
<td valign=top>col 1</td>
<td valign=top>col 2</td>
</tr>
<tr valign=top>
<td valign=top>col 1</td>
<td valign=top>col 2</td>
</tr
</tableMaybe I didn't really get your question, but I do not see a grid in the
3rd column.
But did you try to put another table into one cell? That often works.

Remy Blaettler
www.collaboral.com

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.

tables ;-(

Hello,
I am trying to stop some behavior going on with a table. I have been
using Visual Studio C# 2005.
Basically, the table has certain column widths to start out with. When
data is added to it (and the size of the column is too small), the data
(in this case text) in the column wraps ;-/
How can I keep the data from wrapping? What would be nice is if no
wrapping to place at all and to just be able to adjust the size of
columns manually. You know - where you place the cursor on the boundary
of the column, the cursor changes and then you can lengthen or shorten
the width of the column in order to see more (or less) data.
So, in a nutshell, I would like for the column widths (as well as the
table length and width) to remain the same size as did from the start.
Adjustment of column widths would take place only when using the mouse
;-)
How can I do this?
TIAIm guessing here, but if you think about what the system would need to do in
order to assess the column width Its unlikely that it is going to do it for
you.
In order to assess the column with of any column, one would have to loop
through each cell and get the context, font and size and then measure this
graphically; For each iteration, one would need to adjust the column width
for each lager than previous cell until the end were reached.
If there is no automatic way of doing this then you would have to do this
manually with code.
Other comments ?
Mr N.
"milkyway" <d0mufasa@.hotmail.com> wrote in message
news:1127803098.346775.281760@.z14g2000cwz.googlegroups.com...
> Hello,
> I am trying to stop some behavior going on with a table. I have been
> using Visual Studio C# 2005.
> Basically, the table has certain column widths to start out with. When
> data is added to it (and the size of the column is too small), the data
> (in this case text) in the column wraps ;-/
> How can I keep the data from wrapping? What would be nice is if no
> wrapping to place at all and to just be able to adjust the size of
> columns manually. You know - where you place the cursor on the boundary
> of the column, the cursor changes and then you can lengthen or shorten
> the width of the column in order to see more (or less) data.
> So, in a nutshell, I would like for the column widths (as well as the
> table length and width) to remain the same size as did from the start.
> Adjustment of column widths would take place only when using the mouse
> ;-)
> How can I do this?
> TIA
>
Try style rule table-layout:fixed;
Eliyahu
"milkyway" <d0mufasa@.hotmail.com> wrote in message
news:1127803098.346775.281760@.z14g2000cwz.googlegroups.com...
> Hello,
> I am trying to stop some behavior going on with a table. I have been
> using Visual Studio C# 2005.
> Basically, the table has certain column widths to start out with. When
> data is added to it (and the size of the column is too small), the data
> (in this case text) in the column wraps ;-/
> How can I keep the data from wrapping? What would be nice is if no
> wrapping to place at all and to just be able to adjust the size of
> columns manually. You know - where you place the cursor on the boundary
> of the column, the cursor changes and then you can lengthen or shorten
> the width of the column in order to see more (or less) data.
> So, in a nutshell, I would like for the column widths (as well as the
> table length and width) to remain the same size as did from the start.
> Adjustment of column widths would take place only when using the mouse
> ;-)
> How can I do this?
> TIA
>
milkyway wrote:
> Hello,
> I am trying to stop some behavior going on with a table. I have been
> using Visual Studio C# 2005.
> Basically, the table has certain column widths to start out with. When
> data is added to it (and the size of the column is too small), the
> data (in this case text) in the column wraps ;-/
> How can I keep the data from wrapping? What would be nice is if no
> wrapping to place at all and to just be able to adjust the size of
> columns manually. You know - where you place the cursor on the
> boundary of the column, the cursor changes and then you can lengthen
> or shorten the width of the column in order to see more (or less)
> data.
> So, in a nutshell, I would like for the column widths (as well as the
> table length and width) to remain the same size as did from the start.
> Adjustment of column widths would take place only when using the mouse
> ;-)
> How can I do this?
> TIA
Watch out for a too-exact layout, one that is "perfect" on your development
machine.
A user might use a different browser, have different installed fonts or uses
by default a font with a different size -> gone is your careful layout!
Hans Kesting
set absolute width and overflow style for each td's content, so it can honor
the width. you would need to write client code to resize the table column
widths (adjust the content widths).
<table border=1>
<tr>
<td nowrap><div style="width:40;overflow:hidden">this fits</div></td>
<td nowrap><div style="width:40;overflow:hidden">this xxxxxxxxxxxxxxxxx
doesn't fit</div></td>
</tr>
</table>
-- bruce (sqlwork.com)
"milkyway" <d0mufasa@.hotmail.com> wrote in message
news:1127803098.346775.281760@.z14g2000cwz.googlegroups.com...
> Hello,
> I am trying to stop some behavior going on with a table. I have been
> using Visual Studio C# 2005.
> Basically, the table has certain column widths to start out with. When
> data is added to it (and the size of the column is too small), the data
> (in this case text) in the column wraps ;-/
> How can I keep the data from wrapping? What would be nice is if no
> wrapping to place at all and to just be able to adjust the size of
> columns manually. You know - where you place the cursor on the boundary
> of the column, the cursor changes and then you can lengthen or shorten
> the width of the column in order to see more (or less) data.
> So, in a nutshell, I would like for the column widths (as well as the
> table length and width) to remain the same size as did from the start.
> Adjustment of column widths would take place only when using the mouse
> ;-)
> How can I do this?
> TIA
>
Thanks to all for the responses ;-)
Bruce Barker wrote:
> set absolute width and overflow style for each td's content, so it can hon
or
> the width. you would need to write client code to resize the table column
> widths (adjust the content widths).
>
How would one approach the writing of clinet code to support the
widths? Is there any sample code available?
> "milkyway" <d0mufasa@.hotmail.com> wrote in message
> news:1127803098.346775.281760@.z14g2000cwz.googlegroups.com...
You could easily ammend this code to suit your table control.
http://www.trainingon.net/Articles/TIP0005.htm
HTH
"milkyway" <d0mufasa@.hotmail.com> wrote in message
news:1127968780.006696.275920@.g43g2000cwa.googlegroups.com...
> Thanks to all for the responses ;-)
> Bruce Barker wrote:
> How would one approach the writing of clinet code to support the
> widths? Is there any sample code available?
>
>
Thanks again - will try it out
Thanks again - will try it out
Put <nobr>text here</nobr> around your text.
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"Mr Newbie" <here@.now.com> wrote in message
news:e1qRrI0wFHA.664@.tk2msftngp13.phx.gbl...
> Im guessing here, but if you think about what the system would need to do
> in order to assess the column width Its unlikely that it is going to do it
> for you.
> In order to assess the column with of any column, one would have to loop
> through each cell and get the context, font and size and then measure this
> graphically; For each iteration, one would need to adjust the column width
> for each lager than previous cell until the end were reached.
> If there is no automatic way of doing this then you would have to do this
> manually with code.
> Other comments ?
> Mr N.
>
> "milkyway" <d0mufasa@.hotmail.com> wrote in message
> news:1127803098.346775.281760@.z14g2000cwz.googlegroups.com...
>

Tuesday, March 13, 2012

td tag generating faulty code

I have created a user control using asp:table control. The control generates
a single column menu controls with 5 rows. each row is supposed to have a
image in link tag. The problem is that ASP.Net framework generates closing
"td" tags on new line. This causes to show extra white pixels at the bottom
of each image. This is because of a known bug in "IE" where it has issues
with closing "td" tag on new line.
Question .... is there a way to control the HTML tags generated by ASP.Net
controls so that I can get the UI the way I want it?
Thanks
Naveen K Kohli
http://www.netomatix.comYou would have to override the Render method of the server control, or
possible create a custom control where you specify the HTML to rendered.
David Lloyd
MCSD .NET
http://LemingtonConsulting.com
This response is supplied "as is" without any representations or warranties.
"Naveen K Kohli" <naveenkohli@.hotmail.com> wrote in message
news:#xNFQq#VFHA.1384@.TK2MSFTNGP09.phx.gbl...
I have created a user control using asp:table control. The control generates
a single column menu controls with 5 rows. each row is supposed to have a
image in link tag. The problem is that ASP.Net framework generates closing
"td" tags on new line. This causes to show extra white pixels at the bottom
of each image. This is because of a known bug in "IE" where it has issues
with closing "td" tag on new line.
Question .... is there a way to control the HTML tags generated by ASP.Net
controls so that I can get the UI the way I want it?
Thanks
Naveen K Kohli
http://www.netomatix.com