Saturday, March 31, 2012

Table Rows

All,
I can only add one row to a Table control. Is there a property that
restricts adding multiple rows? I've tried several different ways.
I've gotten to the point where I can add the information I need for
the second row but it only replaces the original info from the first
row, resulting in still only one row.
ThanksHow exactly are you trying to do this, in code, based on populating from
database?
(show us how you're trying to do it)
David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
"Looch" <lucianoj2005@.yahoo.com> wrote in message
news:22db0303-349e-4e5e-a6f9-003c3cde7333@.62g2000hsn.googlegroups.com...
> All,
> I can only add one row to a Table control. Is there a property that
> restricts adding multiple rows? I've tried several different ways.
> I've gotten to the point where I can add the information I need for
> the second row but it only replaces the original info from the first
> row, resulting in still only one row.
> Thanks
Here's the code I'm using, the 'else' statement below never gets ran
regardlesss how many times the cmdAdd button is clicked.
protected void Page_Load(object sender, EventArgs e)
{
ddlQuantity.Items.Clear();
ddlItem.Items.Clear();
ddlQuantity.Items.Add("1");
ddlQuantity.Items.Add("2");
ddlQuantity.Items.Add("3");
ddlQuantity.Items.Add("4");
ddlItem.Items.Add("Test");
ddlItem.Items.Add("Test2");
Session.Add("RowCount", (int)ItemTable.Rows.Count);
}
protected void cmdAdd_Click(object sender, EventArgs e)
{
if (Convert.ToInt32(Session["RowCount"]) == 0) //For the first
time cmdAdd is clicked
{
row.ID = "row" + ItemTable.Rows.Count.ToString();
cell.Width = 343;
cell.ID = "cell" + ItemTable.Rows.Count.ToString();
cell2.Width = 125;
cell2.ID = "cell2" + ItemTable.Rows.Count.ToString();
cell2.HorizontalAlign = HorizontalAlign.Center;
ItemTable.Rows.Add(row);
row.Cells.Add(cell);
row.Cells.Add(cell2);
ItemTable.Rows[0].Cells[0].Text = ddlItem.Text;
ItemTable.Rows[0].Cells[1].Text = ddlQuantity.Text;
ItemsToOrder items = new ItemsToOrder();
items.ItemName = ddlItem.Text;
items.Quantity = ddlQuantity.Text;
Session.Add("ItemOrder", items);
Session["RowCount"] = ItemTable.Rows.Count;
}
else //For every other time the button is clicked
{
txtPendingShip.Text = "Test";
}
}
Is there any reason you would need to rebuild the items in the dropdownlist
on every postback, and not surround it with an if/then/postback block?
David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
"Looch" <lucianoj2005@.yahoo.com> wrote in message
news:d55f2313-88be-4980-83ab-b43430b9b674@.62g2000hsn.googlegroups.com...
> Here's the code I'm using, the 'else' statement below never gets ran
> regardlesss how many times the cmdAdd button is clicked.
> protected void Page_Load(object sender, EventArgs e)
> {
> ddlQuantity.Items.Clear();
> ddlItem.Items.Clear();
> ddlQuantity.Items.Add("1");
> ddlQuantity.Items.Add("2");
> ddlQuantity.Items.Add("3");
> ddlQuantity.Items.Add("4");
> ddlItem.Items.Add("Test");
> ddlItem.Items.Add("Test2");
> Session.Add("RowCount", (int)ItemTable.Rows.Count);
> }
> protected void cmdAdd_Click(object sender, EventArgs e)
> {
> if (Convert.ToInt32(Session["RowCount"]) == 0) //For the first
> time cmdAdd is clicked
> {
> row.ID = "row" + ItemTable.Rows.Count.ToString();
> cell.Width = 343;
> cell.ID = "cell" + ItemTable.Rows.Count.ToString();
> cell2.Width = 125;
> cell2.ID = "cell2" + ItemTable.Rows.Count.ToString();
> cell2.HorizontalAlign = HorizontalAlign.Center;
> ItemTable.Rows.Add(row);
> row.Cells.Add(cell);
> row.Cells.Add(cell2);
> ItemTable.Rows[0].Cells[0].Text = ddlItem.Text;
> ItemTable.Rows[0].Cells[1].Text = ddlQuantity.Text;
> ItemsToOrder items = new ItemsToOrder();
> items.ItemName = ddlItem.Text;
> items.Quantity = ddlQuantity.Text;
> Session.Add("ItemOrder", items);
> Session["RowCount"] = ItemTable.Rows.Count;
> }
> else //For every other time the button is clicked
> {
> txtPendingShip.Text = "Test";
> }
> }
I was going to address that once I got past the row adding hurdle,
I've been stuck on that for about a day now...
Looch wrote:
> ItemTable.Rows.Add(row);
Try
ItemTable.Rows.Add(row.Clone);
otherwise you're always adding a /reference/ to the same variable rather
than the data in that variable.
Andrew

Table Rows

Hello,
I have dynamically created a table in ASP.NET using tbl.rows.add(tr)
method where 'tbl' is a System.Web.UI.WebControls.Table. and tr is a
TableRows object.
Any ideas why I can't then itterate through the table object and reference
each of the rows using:
Dim tb as tablesRow
For Each tr In tbl.Rows
xx = tr.Cells(1).Text
Next
There appears to be no rows in the table ie. tbl.tablerows.count = 0
TIA
TimDim t as new table
Page.Controls.Add(t)
Dim r As TableRow
Dim c As TableCell
For i As Int32 = 0 To 5
r = New TableRow
c = New TableCell
c.Text = i.ToString
r.Cells.Add(c)
t.Rows.Add(r)
Next
For Each r In t.Rows
Response.Write("<BR>Cell Value = " & r.Cells(0).Text)
Next
"Tim" <timbryant@.smoothit.co.uk> wrote in message
news:OUr4bISvFHA.2064@.TK2MSFTNGP09.phx.gbl...
> Hello,
> I have dynamically created a table in ASP.NET using tbl.rows.add(tr)
> method where 'tbl' is a System.Web.UI.WebControls.Table. and tr is a
> TableRows object.
> Any ideas why I can't then itterate through the table object and reference
> each of the rows using:
> Dim tb as tablesRow
> For Each tr In tbl.Rows
> xx = tr.Cells(1).Text
> Next
> There appears to be no rows in the table ie. tbl.tablerows.count = 0
> TIA
> Tim
>
>
Tim,
If you are trying to access the rows on postback, note, that you have to
re-create dynamucally created objects in the code.
Eliyahu
"Tim" <timbryant@.smoothit.co.uk> wrote in message
news:OUr4bISvFHA.2064@.TK2MSFTNGP09.phx.gbl...
> Hello,
> I have dynamically created a table in ASP.NET using tbl.rows.add(tr)
> method where 'tbl' is a System.Web.UI.WebControls.Table. and tr is a
> TableRows object.
> Any ideas why I can't then itterate through the table object and reference
> each of the rows using:
> Dim tb as tablesRow
> For Each tr In tbl.Rows
> xx = tr.Cells(1).Text
> Next
> There appears to be no rows in the table ie. tbl.tablerows.count = 0
> TIA
> Tim
>
>

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 Schema Editor

Friends are there any tools/controls in asp.net which can help design create
a table in a database.
thanks!!!There are many databases out there, and many tools for creating database
objects in them. There are some tools as well in VS.Net.

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Big things are made up of
lots of Little things.

"sunil" <sunil_godiyal@.yahoo.com> wrote in message
news:eVgxxNAPDHA.3016@.TK2MSFTNGP10.phx.gbl...
> Friends are there any tools/controls in asp.net which can help design
create
> a table in a database.
> thanks!!!
Ah, thanks for the clarification. Hopefully someone here knows of such
third-party apps.

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Big things are made up of
lots of Little things.

"sunil" <sunil_godiyal@.yahoo.com> wrote in message
news:u1QzTxAPDHA.1216@.TK2MSFTNGP11.phx.gbl...
> Kevin, Thanks for your reply. Here is my problem. I want the user using
my
> web application to be able to create table using the web interface
provided
> with in the web app. Iam looking for any activex controls or asp.net
> components which can do this.
> Appreciate your help.
> Thanks
>
> "Kevin Spencer" <kevin@.SPAMMERSSUCKtakempis.com> wrote in message
> news:%23S9lmhAPDHA.4024@.tk2msftngp13.phx.gbl...
> > There are many databases out there, and many tools for creating database
> > objects in them. There are some tools as well in VS.Net.
> > HTH,
> > Kevin Spencer
> > Microsoft FrontPage MVP
> > Internet Developer
> > http://www.takempis.com
> > Big things are made up of
> > lots of Little things.
> > "sunil" <sunil_godiyal@.yahoo.com> wrote in message
> > news:eVgxxNAPDHA.3016@.TK2MSFTNGP10.phx.gbl...
> > > Friends are there any tools/controls in asp.net which can help design
> > create
> > > a table in a database.
> > > thanks!!!
> >

table run at server

I want to have an table like this
<table>
if session("userid") <> "" then
<tr><td><droplist></td></tr>
else
<tr><td><hiddeninput></td></tr>
end If

Anybody know how to solve that in .NET and codebehind?Hi,

HTML
=====


<TABLE id="Table1" border="0">
<TR>
<TD>
<asp:DropDownList id="DropDownList1" runat="server">
<asp:ListItem Value="BlahBlah">BlahBlah</asp:ListItem>
</asp:DropDownList>
</TD>
</TR>
</TABLE>

code-behind
===========


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

If Session("userid") <> "" Then
DropDownList1.Visible = True
Else
DropDownList1.Visible = False
End If

End Sub

HTH
Thanks, but i asked for the tablerow, cause I have labels and so on that don't is supposed to been shown either.

I solved it surfing around like. (My Row that is going to be hidden is Row #3.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Session("userid") <> "" Then
Table1.Rows(3).Visible = True
Else
Table1.Rows(3)..Visible = False
End If
End Sub

table sizing

I am in my second chapter of trying to learn asp.net and I have my first issue. I am working on an example that asks that I create a HTML table 4x2(RxC) via the web matrix interface. I am not using web matirx, I am with the Visual.NET IDE.
I have inserted a table on the webForm via the HTML tool box, the one under components, and I can not create the 4x2 table. Each time I change the Rows to 4, it keeps getting changed back to 2 when I apply the change.
Why?Vs 03 is notorious for screwing up html code.
Best bet do this:
<table>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
</table>
Alternativly i think theres an insert table command on the menu for vs03, which should let you specify 4x2 and insert you a new table.
Or if the book is working from Web Matrix then maybe you should too, after all its a free download from this site :)
Hope this helps,
Andrew
You may be better off using the web form table, not the one on the html portion of the toolbox.
Use the table menu in the top menu bar.
Zath
Thanks, I am learning quickly the quirks of VS.
Thanks.

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

Table stucture changing when panel is displayed

Hi All,
I am having a wierd problem while displaying my panel. My code is
something like this

<table>
<tr>
<td width=100>label</td>
<td width=100>label</td>
<td width=100>label</td>
<td width=100>button in this cell</td>
</tr>
<tr>
<td colspan=4 width=400>
<panel>literal inside the panel</panel>
</td>
</tr>
</table
this is actually the structure of my repeater control, and I am
toggling the visibility of my panel on the client side, whenever the
button in the first row is clicked.
The approach works fine when the text in the literal is shorter than
the table width, which is 400. But, when it is longer and it had to be
wrapped, the entire table structure is messed up, the colums widths are
changing at each toggle of the panel display.
However, if I insert line breaks(<br>)in literal string, so that the
string between two line breaks is less than the page width, its working
perfect.
any idea why the table structure is messed up when the string is larger
than page width.

Any help is greatly appreciated.

ThanksPavan,

I think those results will vary from browser to browser depending on how
they render.

Have you tried using percentages for the widths instead of fixed values? (I
would try that - at least for the last column with the panel in it.)

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Pavan" <pavan27@.gmail.com> wrote in message
news:1126828985.224647.157820@.z14g2000cwz.googlegr oups.com...
> Hi All,
> I am having a wierd problem while displaying my panel. My code is
> something like this
> <table>
> <tr>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>button in this cell</td>
> </tr>
> <tr>
> <td colspan=4 width=400>
> <panel>literal inside the panel</panel>
> </td>
> </tr>
> </table>
> this is actually the structure of my repeater control, and I am
> toggling the visibility of my panel on the client side, whenever the
> button in the first row is clicked.
> The approach works fine when the text in the literal is shorter than
> the table width, which is 400. But, when it is longer and it had to be
> wrapped, the entire table structure is messed up, the colums widths are
> changing at each toggle of the panel display.
> However, if I insert line breaks(<br>)in literal string, so that the
> string between two line breaks is less than the page width, its working
> perfect.
> any idea why the table structure is messed up when the string is larger
> than page width.
> Any help is greatly appreciated.
> Thanks
tables alway resize to hold their content, unless the content has overflow
rules that prevents the content from getting larger.

try (large content is scrolled):

<table>
<tr>
<td width=100>label</td>
<td width=100>label</td>
<td width=100>label</td>
<td width=100>button in this cell</td>
</tr>
<tr>
<td colspan=4>
<div style="width:100%;overflow:auto;">literal inside the div</div>
</td>
</tr>
</table
note: panel is not a valid html object

-- bruce (sqlwork.com)

"Pavan" <pavan27@.gmail.com> wrote in message
news:1126828985.224647.157820@.z14g2000cwz.googlegr oups.com...
> Hi All,
> I am having a wierd problem while displaying my panel. My code is
> something like this
> <table>
> <tr>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>button in this cell</td>
> </tr>
> <tr>
> <td colspan=4 width=400>
> <panel>literal inside the panel</panel>
> </td>
> </tr>
> </table>
> this is actually the structure of my repeater control, and I am
> toggling the visibility of my panel on the client side, whenever the
> button in the first row is clicked.
> The approach works fine when the text in the literal is shorter than
> the table width, which is 400. But, when it is longer and it had to be
> wrapped, the entire table structure is messed up, the colums widths are
> changing at each toggle of the panel display.
> However, if I insert line breaks(<br>)in literal string, so that the
> string between two line breaks is less than the page width, its working
> perfect.
> any idea why the table structure is messed up when the string is larger
> than page width.
> Any help is greatly appreciated.
> Thanks
Justin, Bruce,
I tried each of your approaches but unfortunately, neither of them
worked.
however, the problem is solved by packaging the literal inside the
panel with a table.

<tr>
<td colspan=4 width=400>
<panel>
<table>
<tr>
<td>literal inside the panel</td>
</tr>
</table>
</panel>
</td>
</tr
I would appreciate if anyone could explain this behavior.

Thanks.

Pavan wrote:
> Hi All,
> I am having a wierd problem while displaying my panel. My code is
> something like this
> <table>
> <tr>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>button in this cell</td>
> </tr>
> <tr>
> <td colspan=4 width=400>
> <panel>literal inside the panel</panel>
> </td>
> </tr>
> </table>
> this is actually the structure of my repeater control, and I am
> toggling the visibility of my panel on the client side, whenever the
> button in the first row is clicked.
> The approach works fine when the text in the literal is shorter than
> the table width, which is 400. But, when it is longer and it had to be
> wrapped, the entire table structure is messed up, the colums widths are
> changing at each toggle of the panel display.
> However, if I insert line breaks(<br>)in literal string, so that the
> string between two line breaks is less than the page width, its working
> perfect.
> any idea why the table structure is messed up when the string is larger
> than page width.
> Any help is greatly appreciated.
> Thanks

Table structure from database.

Hi,

Is it possible to retrieve in C# the table structure (primary key, type of data, ...) ?

Thanks a lot.

Sébfrom what database?
from sql server 2000 for example ...
From sql server sir :)
I am not sure that my suggests will solve your problems,
I think that you should write a Sql statement as follow:

ALTER DATABASE database
{ ADD FILE < filespec > [ ,...n ] [ TO FILEGROUP filegroup_name ]
| ADD LOG FILE < filespec > [ ,...n ]
| REMOVE FILE logical_file_name
| ADD FILEGROUP filegroup_name
| REMOVE FILEGROUP filegroup_name
| MODIFY FILE < filespec >
| MODIFY NAME = new_dbname
| MODIFY FILEGROUP filegroup_name {filegroup_property | NAME = new_filegroup_name }
| SET < optionspec > [ ,...n ] [ WITH < termination > ]
| COLLATE < collation_name >
}

SqlClient.ExcuteNonQuery(......);
SQL server 2000 why ?

Thanks

Séb
I'm interested in the structure of Access and SQL databases

Table stretching excessively in IE

Hello all... i have a really frsutrating problem here...
This is only happening in IE (6 & 7b2), Mozilla and Netscape are both OK.
I have a top-level table with a width of 760px, so it should be 760 minimum
and stretching wider as needed to fit content (such as bound datagrids).
In the top TR/TD, i have a header table which is width of 100%, and has
three TD's. Each contains one image file, with the middle TD being set to
width 100%.
So the td should push the end TDs to as narrow as the images in them, which
works perfectly. The middle TD is giving me a problem though. If it is
empty, then everything behaves as expected, with the whole content being
760px minimum, stretching as needed.
Next i try to add an image to the middle td of the header table. I would
expect the TD to stretch bigger as needed to fit the width of the picture.
Instead it stretches wider to fit the width of the image PLUS an additional
190 pixels of just empty whitespace, which screws up the layout of my page
now.
Anyone seen this before or have an idea how to fix it? I tried putting a
style="float: <value>" on the middle image as sometimes that fixes weird
image layout problems, but it didnt help. I also tried GIFs instead of PNGs
but that was no help either.
Essentially the code looks like this:
<table width="760px">
<tr><td id="tdHeader">
<table width="100%">
<tr><td>
<img src="http://pics.10026.com/?src=/images/headerLeft.png" >
</td></td>
<tr><td width="100%">
<img src="http://pics.10026.com/?src=/images/headerMiddle.png" >
<!-- it renders an extra 190px of width right
here -->
</td></td>
<tr><td>
<img src="http://pics.10026.com/?src=/images/headerRight.png" >
</td></td>
</table>
</td></td>
<tr><td id="tdContent"></td></td>
<tr><td id="tdFooter"></td></td>
</table>Hi,
Arthur Dent wrote:
> Hello all... i have a really frsutrating problem here...
> This is only happening in IE (6 & 7b2), Mozilla and Netscape are both OK.
> I have a top-level table with a width of 760px, so it should be 760 minimu
m
> and stretching wider as needed to fit content (such as bound datagrids).
> In the top TR/TD, i have a header table which is width of 100%, and has
> three TD's. Each contains one image file, with the middle TD being set to
> width 100%.
> So the td should push the end TDs to as narrow as the images in them, whic
h
> works perfectly. The middle TD is giving me a problem though. If it is
> empty, then everything behaves as expected, with the whole content being
> 760px minimum, stretching as needed.
> Next i try to add an image to the middle td of the header table. I would
> expect the TD to stretch bigger as needed to fit the width of the picture.
> Instead it stretches wider to fit the width of the image PLUS an additiona
l
> 190 pixels of just empty whitespace, which screws up the layout of my page
> now.
> Anyone seen this before or have an idea how to fix it? I tried putting a
> style="float: <value>" on the middle image as sometimes that fixes weird
> image layout problems, but it didnt help. I also tried GIFs instead of PNG
s
> but that was no help either.
> Essentially the code looks like this:
> <table width="760px">
> <tr><td id="tdHeader">
> <table width="100%">
> <tr><td>
> <img src="http://pics.10026.com/?src=/images/headerLeft.png" >
> </td></td>
> <tr><td width="100%">
> <img src="http://pics.10026.com/?src=/images/headerMiddle.png" >
> <!-- it renders an extra 190px of width right
> here -->
> </td></td>
> <tr><td>
> <img src="http://pics.10026.com/?src=/images/headerRight.png" >
> </td></td>
> </table>
> </td></td>
> <tr><td id="tdContent"></td></td>
> <tr><td id="tdFooter"></td></td>
> </table>
First, your table is invalid. You have a </td> too much and a </tr> too
little.
Then, I noticed strange effects when unnecessary carriage returns were
placed in a table. Try this:
<table width="760px">
<tr>
<td id="tdHeader">
<table width="100%">
<tr>
<td><img src="http://pics.10026.com/?src=/images/headerLeft.png"></td>
</tr>
<tr>
<td width="100%"><img src="http://pics.10026.com/?src=/images/headerMiddle.png"></td>
</tr>
<tr>
<td><img src="http://pics.10026.com/?src=/images/headerRight.png"></td>
</tr>
</table>
</td>
</tr>
<tr><td id="tdContent"></td></tr>
<tr><td id="tdFooter"></td></tr>
</table>
HTH,
Laurent
Oops, yah, those extra TDs were supposed to be TRs. Typo - i manually typed
that in the msg instead of copy/pasting.
I tried putting all my TD content on one line as in :
<td><img src='/images/someImage.gif'></td>
but to no avail... it still keeps the table wider than it needs to be by
the same approx. 190 px.
Thanks for the idea though. :) .
"Laurent Bugnion" <galasoft-lb@.bluewin.ch> wrote in message
news:O9lB7zdQGHA.5116@.TK2MSFTNGP10.phx.gbl...
> Hi,
> Arthur Dent wrote:
> First, your table is invalid. You have a </td> too much and a </tr> too
> little.
> Then, I noticed strange effects when unnecessary carriage returns were
> placed in a table. Try this:
> <table width="760px">
> <tr>
> <td id="tdHeader">
> <table width="100%">
> <tr>
> <td><img src="http://pics.10026.com/?src=/images/headerLeft.png"></td>
> </tr>
> <tr>
> <td width="100%"><img src="http://pics.10026.com/?src=/images/headerMiddle.png"></td>
> </tr>
> <tr>
> <td><img src="http://pics.10026.com/?src=/images/headerRight.png"></td>
> </tr>
> </table>
> </td>
> </tr>
> <tr><td id="tdContent"></td></tr>
> <tr><td id="tdFooter"></td></tr>
> </table>
> HTH,
> Laurent
Hi Arthur,
Arthur Dent wrote:
> Oops, yah, those extra TDs were supposed to be TRs. Typo - i manually type
d
> that in the msg instead of copy/pasting.
> I tried putting all my TD content on one line as in :
> <td><img src='/images/someImage.gif'></td>
> but to no avail... it still keeps the table wider than it needs to be by
> the same approx. 190 px.
> Thanks for the idea though. :) .
Can you email me the HTML/CSS code that displays the problem? If I can
reproduce it, I'll try to solve it.
Greetings,
Laurent
Instead setting the middle TD's width to 100%, try setting the end TDs'
width to 1%, and leave the middle TD's width blank. This is how I
always do it, and it works like a charm in IE.
HTH
Luke

Table stretching excessively in IE

Hello all... i have a really frsutrating problem here...
This is only happening in IE (6 & 7b2), Mozilla and Netscape are both OK.

I have a top-level table with a width of 760px, so it should be 760 minimum
and stretching wider as needed to fit content (such as bound datagrids).
In the top TR/TD, i have a header table which is width of 100%, and has
three TD's. Each contains one image file, with the middle TD being set to
width 100%.
So the td should push the end TDs to as narrow as the images in them, which
works perfectly. The middle TD is giving me a problem though. If it is
empty, then everything behaves as expected, with the whole content being
760px minimum, stretching as needed.
Next i try to add an image to the middle td of the header table. I would
expect the TD to stretch bigger as needed to fit the width of the picture.
Instead it stretches wider to fit the width of the image PLUS an additional
190 pixels of just empty whitespace, which screws up the layout of my page
now.

Anyone seen this before or have an idea how to fix it? I tried putting a
style="float: <value>" on the middle image as sometimes that fixes weird
image layout problems, but it didnt help. I also tried GIFs instead of PNGs
but that was no help either.

Essentially the code looks like this:

<table width="760px">
<tr><td id="tdHeader">
<table width="100%">
<tr><td>
<img src="http://pics.10026.com/?src=/images/headerLeft.png" >
</td></td>
<tr><td width="100%">
<img src="http://pics.10026.com/?src=/images/headerMiddle.png" >
<!-- it renders an extra 190px of width right
here -->
</td></td>
<tr><td>
<img src="http://pics.10026.com/?src=/images/headerRight.png" >
</td></td>
</table>
</td></td>
<tr><td id="tdContent"></td></td>
<tr><td id="tdFooter"></td></td>
</tableHi,

Arthur Dent wrote:
> Hello all... i have a really frsutrating problem here...
> This is only happening in IE (6 & 7b2), Mozilla and Netscape are both OK.
> I have a top-level table with a width of 760px, so it should be 760 minimum
> and stretching wider as needed to fit content (such as bound datagrids).
> In the top TR/TD, i have a header table which is width of 100%, and has
> three TD's. Each contains one image file, with the middle TD being set to
> width 100%.
> So the td should push the end TDs to as narrow as the images in them, which
> works perfectly. The middle TD is giving me a problem though. If it is
> empty, then everything behaves as expected, with the whole content being
> 760px minimum, stretching as needed.
> Next i try to add an image to the middle td of the header table. I would
> expect the TD to stretch bigger as needed to fit the width of the picture.
> Instead it stretches wider to fit the width of the image PLUS an additional
> 190 pixels of just empty whitespace, which screws up the layout of my page
> now.
> Anyone seen this before or have an idea how to fix it? I tried putting a
> style="float: <value>" on the middle image as sometimes that fixes weird
> image layout problems, but it didnt help. I also tried GIFs instead of PNGs
> but that was no help either.
> Essentially the code looks like this:
> <table width="760px">
> <tr><td id="tdHeader">
> <table width="100%">
> <tr><td>
> <img src="http://pics.10026.com/?src=/images/headerLeft.png" >
> </td></td>
> <tr><td width="100%">
> <img src="http://pics.10026.com/?src=/images/headerMiddle.png" >
> <!-- it renders an extra 190px of width right
> here -->
> </td></td>
> <tr><td>
> <img src="http://pics.10026.com/?src=/images/headerRight.png" >
> </td></td>
> </table>
> </td></td>
> <tr><td id="tdContent"></td></td>
> <tr><td id="tdFooter"></td></td>
> </table
First, your table is invalid. You have a </td> too much and a </tr> too
little.

Then, I noticed strange effects when unnecessary carriage returns were
placed in a table. Try this:

<table width="760px">
<tr>
<td id="tdHeader">
<table width="100%">
<tr>
<td><img src="http://pics.10026.com/?src=/images/headerLeft.png"></td>
</tr>
<tr>
<td width="100%"><img src="http://pics.10026.com/?src=/images/headerMiddle.png"></td>
</tr>
<tr>
<td><img src="http://pics.10026.com/?src=/images/headerRight.png"></td>
</tr>
</table>
</td>
</tr>
<tr><td id="tdContent"></td></tr>
<tr><td id="tdFooter"></td></tr>
</table
HTH,
Laurent
Oops, yah, those extra TDs were supposed to be TRs. Typo - i manually typed
that in the msg instead of copy/pasting.

I tried putting all my TD content on one line as in :

<td><img src='/images/someImage.gif'></td
but to no avail... it still keeps the table wider than it needs to be by
the same approx. 190 px.
Thanks for the idea though. :) .

"Laurent Bugnion" <galasoft-lb@.bluewin.ch> wrote in message
news:O9lB7zdQGHA.5116@.TK2MSFTNGP10.phx.gbl...
> Hi,
> Arthur Dent wrote:
>> Hello all... i have a really frsutrating problem here...
>> This is only happening in IE (6 & 7b2), Mozilla and Netscape are both OK.
>>
>> I have a top-level table with a width of 760px, so it should be 760
>> minimum and stretching wider as needed to fit content (such as bound
>> datagrids).
>> In the top TR/TD, i have a header table which is width of 100%, and has
>> three TD's. Each contains one image file, with the middle TD being set to
>> width 100%.
>> So the td should push the end TDs to as narrow as the images in them,
>> which works perfectly. The middle TD is giving me a problem though. If it
>> is empty, then everything behaves as expected, with the whole content
>> being 760px minimum, stretching as needed.
>> Next i try to add an image to the middle td of the header table. I would
>> expect the TD to stretch bigger as needed to fit the width of the
>> picture. Instead it stretches wider to fit the width of the image PLUS an
>> additional 190 pixels of just empty whitespace, which screws up the
>> layout of my page now.
>>
>> Anyone seen this before or have an idea how to fix it? I tried putting a
>> style="float: <value>" on the middle image as sometimes that fixes weird
>> image layout problems, but it didnt help. I also tried GIFs instead of
>> PNGs but that was no help either.
>>
>> Essentially the code looks like this:
>>
>> <table width="760px">
>> <tr><td id="tdHeader">
>> <table width="100%">
>> <tr><td>
>> <img src="http://pics.10026.com/?src=/images/headerLeft.png" >
>> </td></td>
>> <tr><td width="100%">
>> <img src="http://pics.10026.com/?src=/images/headerMiddle.png" >
>> <!-- it renders an extra 190px of width right
>> here -->
>> </td></td>
>> <tr><td>
>> <img src="http://pics.10026.com/?src=/images/headerRight.png" >
>> </td></td>
>> </table>
>> </td></td>
>> <tr><td id="tdContent"></td></td>
>> <tr><td id="tdFooter"></td></td>
>> </table>
> First, your table is invalid. You have a </td> too much and a </tr> too
> little.
> Then, I noticed strange effects when unnecessary carriage returns were
> placed in a table. Try this:
> <table width="760px">
> <tr>
> <td id="tdHeader">
> <table width="100%">
> <tr>
> <td><img src="http://pics.10026.com/?src=/images/headerLeft.png"></td>
> </tr>
> <tr>
> <td width="100%"><img src="http://pics.10026.com/?src=/images/headerMiddle.png"></td>
> </tr>
> <tr>
> <td><img src="http://pics.10026.com/?src=/images/headerRight.png"></td>
> </tr>
> </table>
> </td>
> </tr>
> <tr><td id="tdContent"></td></tr>
> <tr><td id="tdFooter"></td></tr>
> </table>
> HTH,
> Laurent
Hi Arthur,

Arthur Dent wrote:
> Oops, yah, those extra TDs were supposed to be TRs. Typo - i manually typed
> that in the msg instead of copy/pasting.
> I tried putting all my TD content on one line as in :
> <td><img src='/images/someImage.gif'></td>
> but to no avail... it still keeps the table wider than it needs to be by
> the same approx. 190 px.
> Thanks for the idea though. :) .

Can you email me the HTML/CSS code that displays the problem? If I can
reproduce it, I'll try to solve it.

Greetings,
Laurent
Instead setting the middle TD's width to 100%, try setting the end TDs'
width to 1%, and leave the middle TD's width blank. This is how I
always do it, and it works like a charm in IE.

HTH
Luke

Table Style

I have the following table in ascx , when I click the button the table style
not showing in the popup , it is ONLY showing on the page not in the
popup...WHY?

<TABLE style="BACKGROUND: #d8e8f5;CURSOR:hand" bgcolor="#d8e8f5"
id="tblMenu" cellSpacing="0"cellPadding="2" width="150" border="1">
<TR>
<TD class="standerdfont" >New Document</TD>
</TR>
<TR>
<TD class="standerdfont">New Folder</TD>
</TR>
</TABLE
this table is shown when user click the button as following:
<TABLE id="Table6" cellSpacing="0" cellPadding="0" width="560" border="0">
<TR>
<TH style="HEIGHT: 14px" vAlign="middle" scope="col" align="right" width="67">
<IMG id=imgAddNew
onmouseover="MM_swapImage('Image15','','/images/<%=strImgName_New_O%>',1)"
style="CURSOR: hand" onclick="showMenu('tblMenu',100,44);"
onmouseout=MM_swapImgRestore() height=23
src="MailTools/images/<%=strImgName_New%>" width=59 border=0 name=Image15
></TH
</table
the javascript function is :

function showMenu(menu, width , height)
{

varlefter= event.clientX;
varleftoff= event.offsetX;
vartopper= event.clientY;
vartopoff= event.offsetY;
varoPopup= window.createPopup();
varoPopBody= oPopup.document.body;
varHTMLContent= eval(menu).innerHTML;
oPopBody.innerHTML = HTMLContent;
oPopup.show(lefter - leftoff - 2, topper - topoff
+22,width,height,document.body);
}In yout javascript function your manipulate with variables. You never change
the html of the popup window. Should be

oPopup.document.body.innerHTML = HTMLContent;

Eliyahu

"Raed Sawalha" <RaedSawalha@.discussions.microsoft.com> wrote in message
news:68DF83CD-6146-4A18-AF92-DBE3AC52FDBE@.microsoft.com...
> I have the following table in ascx , when I click the button the table
style
> not showing in the popup , it is ONLY showing on the page not in the
> popup...WHY?
> <TABLE style="BACKGROUND: #d8e8f5;CURSOR:hand" bgcolor="#d8e8f5"
> id="tblMenu" cellSpacing="0" cellPadding="2" width="150" border="1">
> <TR>
> <TD class="standerdfont" >New Document</TD>
> </TR>
> <TR>
> <TD class="standerdfont">New Folder</TD>
> </TR>
> </TABLE>
> this table is shown when user click the button as following:
> <TABLE id="Table6" cellSpacing="0" cellPadding="0" width="560" border="0">
> <TR>
> <TH style="HEIGHT: 14px" vAlign="middle" scope="col" align="right"
width="67">
> <IMG id=imgAddNew
> onmouseover="MM_swapImage('Image15','','/images/<%=strImgName_New_O%>',1)"
> style="CURSOR: hand" onclick="showMenu('tblMenu',100,44);"
> onmouseout=MM_swapImgRestore() height=23
> src="http://pics.10026.com/?src=MailTools/images/<%=strImgName_New%>" width=59 border=0 name=Image15
> ></TH>
> </table>
>
> the javascript function is :
>
> function showMenu(menu, width , height)
> {
> var lefter = event.clientX;
> var leftoff = event.offsetX;
> var topper = event.clientY;
> var topoff = event.offsetY;
> var oPopup = window.createPopup();
> var oPopBody = oPopup.document.body;
> var HTMLContent = eval(menu).innerHTML;
> oPopBody.innerHTML = HTMLContent;
> oPopup.show(lefter - leftoff - 2, topper - topoff
> + 22, width,height,document.body);
> }
I modified it as following and still wont display the table style

function showMenu(menu, width , height)
{

varlefter= event.clientX;
varleftoff= event.offsetX;
vartopper= event.clientY;
vartopoff= event.offsetY;
varoPopup= window.createPopup();
varHTMLContent= eval(menu).innerHTML;
oPopup.document.body.innerHTML = HTMLContent;
oPopup.show(lefter - leftoff - 2, topper - topoff
+22,width,/*newHeight*/height,document.body);
}

"Eliyahu Goldin" wrote:

> In yout javascript function your manipulate with variables. You never change
> the html of the popup window. Should be
> oPopup.document.body.innerHTML = HTMLContent;
> Eliyahu
> "Raed Sawalha" <RaedSawalha@.discussions.microsoft.com> wrote in message
> news:68DF83CD-6146-4A18-AF92-DBE3AC52FDBE@.microsoft.com...
> > I have the following table in ascx , when I click the button the table
> style
> > not showing in the popup , it is ONLY showing on the page not in the
> > popup...WHY?
> > <TABLE style="BACKGROUND: #d8e8f5;CURSOR:hand" bgcolor="#d8e8f5"
> > id="tblMenu" cellSpacing="0" cellPadding="2" width="150" border="1">
> > <TR>
> > <TD class="standerdfont" >New Document</TD>
> > </TR>
> > <TR>
> > <TD class="standerdfont">New Folder</TD>
> > </TR>
> > </TABLE>
> > this table is shown when user click the button as following:
> > <TABLE id="Table6" cellSpacing="0" cellPadding="0" width="560" border="0">
> > <TR>
> > <TH style="HEIGHT: 14px" vAlign="middle" scope="col" align="right"
> width="67">
> > <IMG id=imgAddNew
> > onmouseover="MM_swapImage('Image15','','/images/<%=strImgName_New_O%>',1)"
> > style="CURSOR: hand" onclick="showMenu('tblMenu',100,44);"
> > onmouseout=MM_swapImgRestore() height=23
> > src="http://pics.10026.com/?src=MailTools/images/<%=strImgName_New%>" width=59 border=0 name=Image15
> > ></TH>
> > </table>
> > the javascript function is :
> > function showMenu(menu, width , height)
> > {
> > var lefter = event.clientX;
> > var leftoff = event.offsetX;
> > var topper = event.clientY;
> > var topoff = event.offsetY;
> > var oPopup = window.createPopup();
> > var oPopBody = oPopup.document.body;
> > var HTMLContent = eval(menu).innerHTML;
> > oPopBody.innerHTML = HTMLContent;
> > oPopup.show(lefter - leftoff - 2, topper - topoff
> > + 22, width,height,document.body);
> > }
>

Table stucture changing when panel is displayed

Hi All,
I am having a wierd problem while displaying my panel. My code is
something like this
<table>
<tr>
<td width=100>label</td>
<td width=100>label</td>
<td width=100>label</td>
<td width=100>button in this cell</td>
</tr>
<tr>
<td colspan=4 width=400>
<panel>literal inside the panel</panel>
</td>
</tr>
</table>
this is actually the structure of my repeater control, and I am
toggling the visibility of my panel on the client side, whenever the
button in the first row is clicked.
The approach works fine when the text in the literal is shorter than
the table width, which is 400. But, when it is longer and it had to be
wrapped, the entire table structure is messed up, the colums widths are
changing at each toggle of the panel display.
However, if I insert line breaks(<br> )in literal string, so that the
string between two line breaks is less than the page width, its working
perfect.
any idea why the table structure is messed up when the string is larger
than page width.
Any help is greatly appreciated.
ThanksPavan,
I think those results will vary from browser to browser depending on how
they render.
Have you tried using percentages for the widths instead of fixed values? (I
would try that - at least for the last column with the panel in it.)
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"Pavan" <pavan27@.gmail.com> wrote in message
news:1126828985.224647.157820@.z14g2000cwz.googlegroups.com...
> Hi All,
> I am having a wierd problem while displaying my panel. My code is
> something like this
> <table>
> <tr>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>button in this cell</td>
> </tr>
> <tr>
> <td colspan=4 width=400>
> <panel>literal inside the panel</panel>
> </td>
> </tr>
> </table>
> this is actually the structure of my repeater control, and I am
> toggling the visibility of my panel on the client side, whenever the
> button in the first row is clicked.
> The approach works fine when the text in the literal is shorter than
> the table width, which is 400. But, when it is longer and it had to be
> wrapped, the entire table structure is messed up, the colums widths are
> changing at each toggle of the panel display.
> However, if I insert line breaks(<br> )in literal string, so that the
> string between two line breaks is less than the page width, its working
> perfect.
> any idea why the table structure is messed up when the string is larger
> than page width.
> Any help is greatly appreciated.
> Thanks
>
tables alway resize to hold their content, unless the content has overflow
rules that prevents the content from getting larger.
try (large content is scrolled):
<table>
<tr>
<td width=100>label</td>
<td width=100>label</td>
<td width=100>label</td>
<td width=100>button in this cell</td>
</tr>
<tr>
<td colspan=4>
<div style="width:100%;overflow:auto;">literal inside the div</div>
</td>
</tr>
</table>
note: panel is not a valid html object
-- bruce (sqlwork.com)
"Pavan" <pavan27@.gmail.com> wrote in message
news:1126828985.224647.157820@.z14g2000cwz.googlegroups.com...
> Hi All,
> I am having a wierd problem while displaying my panel. My code is
> something like this
> <table>
> <tr>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>button in this cell</td>
> </tr>
> <tr>
> <td colspan=4 width=400>
> <panel>literal inside the panel</panel>
> </td>
> </tr>
> </table>
> this is actually the structure of my repeater control, and I am
> toggling the visibility of my panel on the client side, whenever the
> button in the first row is clicked.
> The approach works fine when the text in the literal is shorter than
> the table width, which is 400. But, when it is longer and it had to be
> wrapped, the entire table structure is messed up, the colums widths are
> changing at each toggle of the panel display.
> However, if I insert line breaks(<br> )in literal string, so that the
> string between two line breaks is less than the page width, its working
> perfect.
> any idea why the table structure is messed up when the string is larger
> than page width.
> Any help is greatly appreciated.
> Thanks
>
Justin, Bruce,
I tried each of your approaches but unfortunately, neither of them
worked.
however, the problem is solved by packaging the literal inside the
panel with a table.
<tr>
<td colspan=4 width=400>
<panel>
<table>
<tr>
<td>literal inside the panel</td>
</tr>
</table>
</panel>
</td>
</tr>
I would appreciate if anyone could explain this behavior.
Thanks.
Pavan wrote:
> Hi All,
> I am having a wierd problem while displaying my panel. My code is
> something like this
> <table>
> <tr>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>button in this cell</td>
> </tr>
> <tr>
> <td colspan=4 width=400>
> <panel>literal inside the panel</panel>
> </td>
> </tr>
> </table>
> this is actually the structure of my repeater control, and I am
> toggling the visibility of my panel on the client side, whenever the
> button in the first row is clicked.
> The approach works fine when the text in the literal is shorter than
> the table width, which is 400. But, when it is longer and it had to be
> wrapped, the entire table structure is messed up, the colums widths are
> changing at each toggle of the panel display.
> However, if I insert line breaks(<br> )in literal string, so that the
> string between two line breaks is less than the page width, its working
> perfect.
> any idea why the table structure is messed up when the string is larger
> than page width.
> Any help is greatly appreciated.
> Thanks

Table to Excel

If I have built a nice pretty HTML table which has all the shading and
coloring and everthing just the way that I want it, is there some "magical"
way to easily translate this into an excel spreadsheet?
I see Excel will take a HTML file in, but when I tried to create a sample
of this but it did not correctly interperet my background color, but did
interpret my text color, which was bad because nothing displayed as they wer
e
both the same color.
I need to maintain colors, borders, shading, bolding. Do I need to create
the sheet cell by cell in code?Jim Heavey wrote:

> If I have built a nice pretty HTML table which has all the shading and
> coloring and everthing just the way that I want it, is there some "magical
"
> way to easily translate this into an excel spreadsheet?
> I see Excel will take a HTML file in, but when I tried to create a sample
> of this but it did not correctly interperet my background color, but did
> interpret my text color, which was bad because nothing displayed as they w
ere
> both the same color.
> I need to maintain colors, borders, shading, bolding. Do I need to create
> the sheet cell by cell in code?
I'd open the table up in IE, copy the table to the clipboard and then
try pasting it into excel. I'm pretty sure doing that works with
microsoft word, but I've never tried it with Excel.
Helen

table that i add at run time, is in the end of page

I"m using this code to add at run time:


Dim maintable As New Table()

Dim row As New TableRow()
Dim cell As New TableCell()
Dim heights As New Unit("200px")
Dim place As New PlaceHolder()
Dim mycontrol As UserControl = LoadControl("smallmenu.ascx")

maintable.Height = heights
maintable.Width = heights

cell.Height = heights
cell.Text = "yaniv"
cell.Controls.Add(mycontrol)

row.Height = heights

row.Cells.Add(cell)

maintable.Rows.Add(row)
maintable.CssClass = "maintable"

Page.Controls.Add(maintable)

place.Controls.Add(mycontrol)

the problem is that the new table sits in the end of the (after the </html> tag) so i get an error massege:
"Control '_ctl2_Button1' of type 'Button' must be placed inside a form tag with runat=server.
"

how can solve that problem?You can use

<asp:table id="maintable" runat="server" width=... height=.. ... > </asp:Table
in your aspx page rather than dynamically creating a maintable in the codebehind.

Use the codebehind to just populate the table rows and columns.

This way you can place the <asp:table... ></asp:Table> wherever you want on the aspx page.

Hope this helps.
i don't want to use the aspx page, because i want this table to inherit to all my other pages...
I dont understand...

If you want to embed the table in all your aspx pages, you can still add an empty asp Table tag like

<asp:Table id="mytable" runat="server"... ...></asp:Table> to every aspx page where you want the table to be displayed.

Now you can still dynamically populate this table from code behind...
sorry to bother, i tried thatone, but the code behind dosen't recognize this table in i add it in the aspx page. i can't run the "maintable.controls.add" in this case. even if i use the dim maintable, and don't you the page.controls.add(maintable) there is no connection between them!
I had the same problem. I asked about it yesterday (only about a DDL).

My kloogy solution was to create a wrapper class:

Public Class ItemPair
Inherits DropDownList
Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)
output.RenderBeginTag("form")
MyBase.Render(output)
End Sub
Protected Overrides Sub AddAttributesToRender(ByVal writer As HtmlTextWriter)
writer.RenderEndTag()
End Sub
End Class

You could probably cut and paste and change a couple words and be set.
I posted another asnwer that hasn't shown up yet but here is the link to my question which was very similar to yours:

http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=516165

table to list

this code is to bring one coloumn in a listbox... when selecting that list corresponding values for that selection should be displayed in my text boxes kept in de form please some one help me...

thanks in advance......

Dim myDB As Database
Dim myRS As dao.Recordset
Dim tdf As TableDef

Private Sub DataList1_Click()

End Sub

Private Sub EXIT_Click()
Unload Me
End Sub

Private Sub Form_Load()
Set myDB = OpenDatabase("C:\deepesh\name.mdb")
Set myRS = myDB.OpenRecordset("details", dbOpenTable)
For Each tdf In myDB.TableDefs
name1.AddItem tdf.name
Next tdf
'If myRS.RecordCount > 0 Then
'myRS.MoveFirst
'End If
If Not myRS.EOF And Not myRS.BOF Then
myRS.MoveFirst
End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
myRS.Close
Set myRS = Nothing
myDB.Close
Set myDB = Nothing
End Sub

Private Sub name1_Change()
Set myRS = myDB.OpenRecordset("select name,street1,street2,city,pincode,phone,pan_number from details where name=""& List1.Text &", dbopendybaset)
myRS.FindFirst "[name] = " & name1.Text & """"
If myRS.RecordCount > 0 Then
'If myRS.NoMatch = False Then
phone.Text = myRS("phone")
street1.Text = myRS("street1")
street2.Text = myRS("sreet2")
city.Text = myRS("city")
pincode.Text = myRS("pincode")
pincode.Text = myRS.Fields(5)
End If
Set myRS = Nothing
End Subbut how to add script i don understand i am new to vb so kindly help
You will need to add a bit of javascript to your listbox. Your spectacularly unstructured code makes it a little difficult to look at, but I figure that 'name1' is the name of your listbox. Use .Attributes.Add() to have it call a bit of javascript that populates a textbox on each click event.
Ok, I'll tell you half of it, since you ought to learn.

First, find out the javascript required to populate a textbox whenever an item in a listbox is clicked. Once you find that javascript, in your codebehind, use

name1.Attributes.Add("onClick",yourjavascripthere);

Keep in mind that the exact id of the textbox must be substituted in 'yourjavascripthere'. For this, you can use string concatenation and use textbox1.ClientId to get the client id of the textbox.
i seriously didnt understand a little bit... can we addd script in vb huh???
Yes. In your codebehind, you can dynamically add javascript to one of your controls. For that, you use name1.Attributes.Add().

So for example...

textbox1.Attributes.Add("onClick","alert('hello!');");

Will cause a messagebox to appear when someone clicks on textbox1.
This is ASP.Net forum and not the VB 6 forum. Please ask the moderators to move this thread to Classic VB forum.
Good call. (slaps forehead)

Table to Grid

How to bind a grid using table?
I've a table and I want to see that data in a grid for sorting and
pagination. Please provide an example.

Thanks,
XDi think you are talking about the datatable,

you must fill a dataset first, then call this,

Datagrid1.Datasource = ds.Tables(0)
Datagrid1.Databind();

This will show the data in your datagrid, also make sure that you turn on
the check in autogenerate columns in Datagrid Property Builder

"SK" wrote:

Quote:

Originally Posted by

How to bind a grid using table?
I've a table and I want to see that data in a grid for sorting and
pagination. Please provide an example.
>
Thanks,
XD
>
>
>


No it is not datatable. It is normal web.UI.webcontrols.Table
I want to view the data in gridview1 than a table.

- Thanks

"Murtaza" <Murtaza@.discussions.microsoft.comwrote in message
news:9C7365A4-7AC3-497D-B383-02D9F700F1C9@.microsoft.com...

Quote:

Originally Posted by

>i think you are talking about the datatable,
>
you must fill a dataset first, then call this,
>
Datagrid1.Datasource = ds.Tables(0)
Datagrid1.Databind();
>
This will show the data in your datagrid, also make sure that you turn on
the check in autogenerate columns in Datagrid Property Builder
>
"SK" wrote:
>

Quote:

Originally Posted by

>How to bind a grid using table?
>I've a table and I want to see that data in a grid for sorting and
>pagination. Please provide an example.
>>
>Thanks,
>XD
>>
>>
>>


Then again you have to follow same approach, construct a datatable, Iterate
through every row of ur HTML table n fill that Datatable then bind that
Datatable to ur gridview...

"XD" wrote:

Quote:

Originally Posted by

No it is not datatable. It is normal web.UI.webcontrols.Table
I want to view the data in gridview1 than a table.
>
- Thanks
>
"Murtaza" <Murtaza@.discussions.microsoft.comwrote in message
news:9C7365A4-7AC3-497D-B383-02D9F700F1C9@.microsoft.com...

Quote:

Originally Posted by

i think you are talking about the datatable,

you must fill a dataset first, then call this,

Datagrid1.Datasource = ds.Tables(0)
Datagrid1.Databind();

This will show the data in your datagrid, also make sure that you turn on
the check in autogenerate columns in Datagrid Property Builder

"SK" wrote:

Quote:

Originally Posted by

How to bind a grid using table?
I've a table and I want to see that data in a grid for sorting and
pagination. Please provide an example.
>
Thanks,
XD
>
>
>


>
>
>

table vs table

hey all,
what is the difference between the table on the webform toolbar and the html
table? when would you want to use the webform table control?
thanks,
rodcharI've found that the table web control is create to use at runtime for
generating tables with variable numbers of rows & columns.
I've found that the HTML table control is much friendlier to use at design
time, allowing cells to be added via right click.
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"rodchar" <rodchar@.discussions.microsoft.com> wrote in message
news:17004143-15F5-4929-A3EA-48EDD28AF4D3@.microsoft.com...
> hey all,
> what is the difference between the table on the webform toolbar and the
> html
> table? when would you want to use the webform table control?
> thanks,
> rodchar
thanks.
"Steve C. Orr [MVP, MCSD]" wrote:

> I've found that the table web control is create to use at runtime for
> generating tables with variable numbers of rows & columns.
> I've found that the HTML table control is much friendlier to use at design
> time, allowing cells to be added via right click.
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "rodchar" <rodchar@.discussions.microsoft.com> wrote in message
> news:17004143-15F5-4929-A3EA-48EDD28AF4D3@.microsoft.com...
>
>
Hi,
I am using the table from webform toolbar and there is always a space at the
bottom when I placed another table with in the first table. I could eliminat
e
the space between two tables on top, left and right, but i am not able to
remove the space at bottom. Is there any way to eliminate the space at the
bottom?
Thanks
Kris
--
Kris
"rodchar" wrote:
> thanks.
> "Steve C. Orr [MVP, MCSD]" wrote:
>
One thing you could try using is CSS. Use
margin-bottom:0px;
to get rid of any extra space below the table. If the table is the last
element on the page, you can also add this to the html BODY tag to get rid
of any extra space that is part of the BODY, if desired. Good Luck!
--
Nathan Sokalski
njsokalski@.hotmail.com
http://www.nathansokalski.com/
"Kris" <Kris@.discussions.microsoft.com> wrote in message
news:76B91E46-392F-4A25-B0D9-D18869939DA2@.microsoft.com...
> Hi,
> I am using the table from webform toolbar and there is always a space at
> the
> bottom when I placed another table with in the first table. I could
> eliminate
> the space between two tables on top, left and right, but i am not able to
> remove the space at bottom. Is there any way to eliminate the space at the
> bottom?
> Thanks
> Kris
> --
> Kris
>
> "rodchar" wrote:
>

table vs table

hey all,

what is the difference between the table on the webform toolbar and the html
table? when would you want to use the webform table control?

thanks,
rodcharI've found that the table web control is create to use at runtime for
generating tables with variable numbers of rows & columns.
I've found that the HTML table control is much friendlier to use at design
time, allowing cells to be added via right click.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"rodchar" <rodchar@.discussions.microsoft.com> wrote in message
news:17004143-15F5-4929-A3EA-48EDD28AF4D3@.microsoft.com...
> hey all,
> what is the difference between the table on the webform toolbar and the
> html
> table? when would you want to use the webform table control?
> thanks,
> rodchar
thanks.

"Steve C. Orr [MVP, MCSD]" wrote:

> I've found that the table web control is create to use at runtime for
> generating tables with variable numbers of rows & columns.
> I've found that the HTML table control is much friendlier to use at design
> time, allowing cells to be added via right click.
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "rodchar" <rodchar@.discussions.microsoft.com> wrote in message
> news:17004143-15F5-4929-A3EA-48EDD28AF4D3@.microsoft.com...
> > hey all,
> > what is the difference between the table on the webform toolbar and the
> > html
> > table? when would you want to use the webform table control?
> > thanks,
> > rodchar
>
Hi,

I am using the table from webform toolbar and there is always a space at the
bottom when I placed another table with in the first table. I could eliminate
the space between two tables on top, left and right, but i am not able to
remove the space at bottom. Is there any way to eliminate the space at the
bottom?

Thanks
Kris
--
Kris

"rodchar" wrote:

> thanks.
> "Steve C. Orr [MVP, MCSD]" wrote:
> > I've found that the table web control is create to use at runtime for
> > generating tables with variable numbers of rows & columns.
> > I've found that the HTML table control is much friendlier to use at design
> > time, allowing cells to be added via right click.
> > --
> > I hope this helps,
> > Steve C. Orr, MCSD, MVP
> > http://SteveOrr.net
> > "rodchar" <rodchar@.discussions.microsoft.com> wrote in message
> > news:17004143-15F5-4929-A3EA-48EDD28AF4D3@.microsoft.com...
> > > hey all,
> > > > what is the difference between the table on the webform toolbar and the
> > > html
> > > table? when would you want to use the webform table control?
> > > > thanks,
> > > rodchar
One thing you could try using is CSS. Use

margin-bottom:0px;

to get rid of any extra space below the table. If the table is the last
element on the page, you can also add this to the html BODY tag to get rid
of any extra space that is part of the BODY, if desired. Good Luck!
--
Nathan Sokalski
njsokalski@.hotmail.com
http://www.nathansokalski.com/

"Kris" <Kris@.discussions.microsoft.com> wrote in message
news:76B91E46-392F-4A25-B0D9-D18869939DA2@.microsoft.com...
> Hi,
> I am using the table from webform toolbar and there is always a space at
> the
> bottom when I placed another table with in the first table. I could
> eliminate
> the space between two tables on top, left and right, but i am not able to
> remove the space at bottom. Is there any way to eliminate the space at the
> bottom?
> Thanks
> Kris
> --
> Kris
>
> "rodchar" wrote:
>> thanks.
>>
>> "Steve C. Orr [MVP, MCSD]" wrote:
>>
>> > I've found that the table web control is create to use at runtime for
>> > generating tables with variable numbers of rows & columns.
>> > I've found that the HTML table control is much friendlier to use at
>> > design
>> > time, allowing cells to be added via right click.
>>> > --
>> > I hope this helps,
>> > Steve C. Orr, MCSD, MVP
>> > http://SteveOrr.net
>>>>> > "rodchar" <rodchar@.discussions.microsoft.com> wrote in message
>> > news:17004143-15F5-4929-A3EA-48EDD28AF4D3@.microsoft.com...
>> > > hey all,
>> >> > > what is the difference between the table on the webform toolbar and
>> > > the
>> > > html
>> > > table? when would you want to use the webform table control?
>> >> > > thanks,
>> > > rodchar
>>>

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.

Table where I want to draw a border around the whole table but not between the cells.

I have a table with multiple cells and I want to draw a box around the
entire table but not around the individual cells. How do I do that?

TIA - Jeff."UJ" <fred@.nowhere.com>'s wild thoughts were released on
Thu, 8 Jun 2006 10:49:39 -0400 bearing the following fruit:

>I have a table with multiple cells and I want to draw a box around the
>entire table but not around the individual cells. How do I do that?
>TIA - Jeff.

IIRC just setting the borders on the table should do it.

Jan Hyde (VB MVP)

--
I don't have a solution but I admire the problem.
If you are asking about a .net table you can do:

Table table = new Table();
table.Style.Add("border-width","1px");
table.Style.Add("border-color","#000000");
table.Style.Add("border-style","solid");

Or just an html table:

<table border="0" style="border-width: 1px; border-color:#000000;
border-style: solid;">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table
And there is a ton of different borders you can use, just google css
border-style

"UJ" wrote:

> I have a table with multiple cells and I want to draw a box around the
> entire table but not around the individual cells. How do I do that?
> TIA - Jeff.
>
But doesn't that put a border around everything including the cells? I need
just a border around the outside of the table.

"Jeremy" <Jeremy@.discussions.microsoft.com> wrote in message
news:D2B4AD7F-6FE3-456F-BF01-AC215EF764B2@.microsoft.com...
> If you are asking about a .net table you can do:
> Table table = new Table();
> table.Style.Add("border-width","1px");
> table.Style.Add("border-color","#000000");
> table.Style.Add("border-style","solid");
> Or just an html table:
> <table border="0" style="border-width: 1px; border-color:#000000;
> border-style: solid;">
> <tr>
> <td> </td>
> <td> </td>
> </tr>
> <tr>
> <td> </td>
> <td> </td>
> </tr>
> </table>
> And there is a ton of different borders you can use, just google css
> border-style
> "UJ" wrote:
>> I have a table with multiple cells and I want to draw a box around the
>> entire table but not around the individual cells. How do I do that?
>>
>> TIA - Jeff.
>>
>>
>
"UJ" <fred@.nowhere.com>'s wild thoughts were released on
Thu, 8 Jun 2006 16:28:28 -0400 bearing the following fruit:

>But doesn't that put a border around everything including the cells? I need
>just a border around the outside of the table.

Have you tried it?

J

>"Jeremy" <Jeremy@.discussions.microsoft.com> wrote in message
>news:D2B4AD7F-6FE3-456F-BF01-AC215EF764B2@.microsoft.com...
>> If you are asking about a .net table you can do:
>>
>> Table table = new Table();
>> table.Style.Add("border-width","1px");
>> table.Style.Add("border-color","#000000");
>> table.Style.Add("border-style","solid");
>>
>> Or just an html table:
>>
>> <table border="0" style="border-width: 1px; border-color:#000000;
>> border-style: solid;">
>> <tr>
>> <td> </td>
>> <td> </td>
>> </tr>
>> <tr>
>> <td> </td>
>> <td> </td>
>> </tr>
>> </table>
>>
>> And there is a ton of different borders you can use, just google css
>> border-style
>>
>> "UJ" wrote:
>>
>>> I have a table with multiple cells and I want to draw a box around the
>>> entire table but not around the individual cells. How do I do that?
>>>
>>> TIA - Jeff.
>>>
>>>
>>
Jan Hyde (VB MVP)

--
A friend of mine just had her 11th baby. Everyone says she's overbearing
(Megan Waves)
I just tried it and it shows the borders on the cells also. Remember - I
just need a border around the entire object - no each individual cell.

TIA.

"Jan Hyde" <StellaDrinker@.REMOVE.ME.uboot.com> wrote in message
news:jjdi821qndfr94ie161fm83mefg2d96a9u@.4ax.com...
> "UJ" <fred@.nowhere.com>'s wild thoughts were released on
> Thu, 8 Jun 2006 16:28:28 -0400 bearing the following fruit:
>>But doesn't that put a border around everything including the cells? I
>>need
>>just a border around the outside of the table.
> Have you tried it?
> J
>>"Jeremy" <Jeremy@.discussions.microsoft.com> wrote in message
>>news:D2B4AD7F-6FE3-456F-BF01-AC215EF764B2@.microsoft.com...
>>> If you are asking about a .net table you can do:
>>>
>>> Table table = new Table();
>>> table.Style.Add("border-width","1px");
>>> table.Style.Add("border-color","#000000");
>>> table.Style.Add("border-style","solid");
>>>
>>> Or just an html table:
>>>
>>> <table border="0" style="border-width: 1px; border-color:#000000;
>>> border-style: solid;">
>>> <tr>
>>> <td> </td>
>>> <td> </td>
>>> </tr>
>>> <tr>
>>> <td> </td>
>>> <td> </td>
>>> </tr>
>>> </table>
>>>
>>> And there is a ton of different borders you can use, just google css
>>> border-style
>>>
>>> "UJ" wrote:
>>>
>>>> I have a table with multiple cells and I want to draw a box around the
>>>> entire table but not around the individual cells. How do I do that?
>>>>
>>>> TIA - Jeff.
>>>>
>>>>
>>>>
>>
>
> Jan Hyde (VB MVP)
> --
> A friend of mine just had her 11th baby. Everyone says she's overbearing
> (Megan Waves)
Try this...it gives you just the outer border.

<table BORDER=1 RULES=NONE FRAME=BOX
kit

*** Sent via Developersdex http://www.developersdex.com ***
"UJ" <fred@.nowhere.com>'s wild thoughts were released on
Fri, 9 Jun 2006 16:38:26 -0400 bearing the following fruit:

>I just tried it and it shows the borders on the cells also. Remember - I
>just need a border around the entire object - no each individual cell.

I can't recraete your problem, my tables are set up in
exactly the way you want (my style sheet sets border-right,
border-top etc) and in IE6, Firefox and Opera I only get a
border round the whole table, cells are unaffected.

J

>TIA.
>"Jan Hyde" <StellaDrinker@.REMOVE.ME.uboot.com> wrote in message
>news:jjdi821qndfr94ie161fm83mefg2d96a9u@.4ax.com...
>> "UJ" <fred@.nowhere.com>'s wild thoughts were released on
>> Thu, 8 Jun 2006 16:28:28 -0400 bearing the following fruit:
>>
>>>But doesn't that put a border around everything including the cells? I
>>>need
>>>just a border around the outside of the table.
>>
>> Have you tried it?
>>
>> J
>>
>>>"Jeremy" <Jeremy@.discussions.microsoft.com> wrote in message
>>>news:D2B4AD7F-6FE3-456F-BF01-AC215EF764B2@.microsoft.com...
>>>> If you are asking about a .net table you can do:
>>>>
>>>> Table table = new Table();
>>>> table.Style.Add("border-width","1px");
>>>> table.Style.Add("border-color","#000000");
>>>> table.Style.Add("border-style","solid");
>>>>
>>>> Or just an html table:
>>>>
>>>> <table border="0" style="border-width: 1px; border-color:#000000;
>>>> border-style: solid;">
>>>> <tr>
>>>> <td> </td>
>>>> <td> </td>
>>>> </tr>
>>>> <tr>
>>>> <td> </td>
>>>> <td> </td>
>>>> </tr>
>>>> </table>
>>>>
>>>> And there is a ton of different borders you can use, just google css
>>>> border-style
>>>>
>>>> "UJ" wrote:
>>>>
>>>>> I have a table with multiple cells and I want to draw a box around the
>>>>> entire table but not around the individual cells. How do I do that?
>>>>>
>>>>> TIA - Jeff.
>>>>>
>>>>>
>>>>>
>>>
>>
>>
>> Jan Hyde (VB MVP)
>>
>> --
>> A friend of mine just had her 11th baby. Everyone says she's overbearing
>> (Megan Waves)
>
Jan Hyde (VB MVP)

--
Polarize: What penguins see with (Hershy)
That works perfectly!

Thanks!

"K B" <kathyburke40@.comcast.net> wrote in message
news:uWzbCnEjGHA.3800@.TK2MSFTNGP03.phx.gbl...
> Try this...it gives you just the outer border.
> <table BORDER=1 RULES=NONE FRAME=BOX>
> kit
>
> *** Sent via Developersdex http://www.developersdex.com ***

Table where I want to draw a border around the whole table but not between the cells.

I have a table with multiple cells and I want to draw a box around the
entire table but not around the individual cells. How do I do that?
TIA - Jeff."UJ" <fred@.nowhere.com>'s wild thoughts were released on
Thu, 8 Jun 2006 10:49:39 -0400 bearing the following fruit:

>I have a table with multiple cells and I want to draw a box around the
>entire table but not around the individual cells. How do I do that?
>TIA - Jeff.
>
IIRC just setting the borders on the table should do it.
Jan Hyde (VB MVP)
I don't have a solution but I admire the problem.
Try this...it gives you just the outer border.
<table BORDER=1 RULES=NONE FRAME=BOX>
kit
*** Sent via Developersdex http://www.examnotes.net ***
That works perfectly!
Thanks!
"K B" <kathyburke40@.comcast.net> wrote in message
news:uWzbCnEjGHA.3800@.TK2MSFTNGP03.phx.gbl...
> Try this...it gives you just the outer border.
> <table BORDER=1 RULES=NONE FRAME=BOX>
> kit
>
> *** Sent via Developersdex http://www.examnotes.net ***

Table where I want to draw a border around the whole table but not

If you are asking about a .net table you can do:
Table table = new Table();
table.Style.Add("border-width","1px");
table.Style.Add("border-color","#000000");
table.Style.Add("border-style","solid");
Or just an html table:
<table border="0" style="border-width: 1px; border-color:#000000;
border-style: solid;">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
And there is a ton of different borders you can use, just google css
border-style
"UJ" wrote:

> I have a table with multiple cells and I want to draw a box around the
> entire table but not around the individual cells. How do I do that?
> TIA - Jeff.
>
>But doesn't that put a border around everything including the cells? I need
just a border around the outside of the table.
"Jeremy" <Jeremy@.discussions.microsoft.com> wrote in message
news:D2B4AD7F-6FE3-456F-BF01-AC215EF764B2@.microsoft.com...
> If you are asking about a .net table you can do:
> Table table = new Table();
> table.Style.Add("border-width","1px");
> table.Style.Add("border-color","#000000");
> table.Style.Add("border-style","solid");
> Or just an html table:
> <table border="0" style="border-width: 1px; border-color:#000000;
> border-style: solid;">
> <tr>
> <td> </td>
> <td> </td>
> </tr>
> <tr>
> <td> </td>
> <td> </td>
> </tr>
> </table>
> And there is a ton of different borders you can use, just google css
> border-style
> "UJ" wrote:
>
"UJ" <fred@.nowhere.com>'s wild thoughts were released on
Thu, 8 Jun 2006 16:28:28 -0400 bearing the following fruit:

>But doesn't that put a border around everything including the cells? I need
>just a border around the outside of the table.
Have you tried it?
J

>"Jeremy" <Jeremy@.discussions.microsoft.com> wrote in message
>news:D2B4AD7F-6FE3-456F-BF01-AC215EF764B2@.microsoft.com...
>
Jan Hyde (VB MVP)
A friend of mine just had her 11th baby. Everyone says she's overbearing
(Megan Waves)
I just tried it and it shows the borders on the cells also. Remember - I
just need a border around the entire object - no each individual cell.
TIA.
"Jan Hyde" <StellaDrinker@.REMOVE.ME.uboot.com> wrote in message
news:jjdi821qndfr94ie161fm83mefg2d96a9u@.
4ax.com...
> "UJ" <fred@.nowhere.com>'s wild thoughts were released on
> Thu, 8 Jun 2006 16:28:28 -0400 bearing the following fruit:
>
> Have you tried it?
> J
>
>
> Jan Hyde (VB MVP)
> --
> A friend of mine just had her 11th baby. Everyone says she's overbearing
> (Megan Waves)
>
"UJ" <fred@.nowhere.com>'s wild thoughts were released on
Fri, 9 Jun 2006 16:38:26 -0400 bearing the following fruit:

>I just tried it and it shows the borders on the cells also. Remember - I
>just need a border around the entire object - no each individual cell.
I can't recraete your problem, my tables are set up in
exactly the way you want (my style sheet sets border-right,
border-top etc) and in IE6, Firefox and Opera I only get a
border round the whole table, cells are unaffected.
J

>TIA.
>"Jan Hyde" <StellaDrinker@.REMOVE.ME.uboot.com> wrote in message
> news:jjdi821qndfr94ie161fm83mefg2d96a9u@.
4ax.com...
>
Jan Hyde (VB MVP)
Polarize: What penguins see with (Hershy)

Table Web Control

I'm using a Table web control to dynamically create checkboxes, and check/uncheck/enable/disable them based on values returned from different datasources. In this case, I'm using several DataTables.

I've completed the table on load, and all of the checkbox controls load up as expected, however I now need to submit any changes based on the users values. I've been googling for a good article on the Table web control but haven't found anything that will help. Does anyone know of any articles, or have sample code for maintaining state of these controls and iterating through them so I can create my dynamic SQL based on selections?

Thanks.From the SDK:

"Note: Programmatic additions or modifications to a table row or cell will not persist across posts to the server. Table rows and cells are controls of their own, not properties of the Table control. Changes to table rows or cells must be reconstructed after each post to the server."

Ok, so I think that answers my viewstate problem. I DO recreate this table on page load everytime, so I don't think I need to worry about that.

Any help on muddling through the selected checkboxes of a dynamically created table web control, would still be very beneficial to my cause.
Ugh, I'm fried here...

The viewstate will STILL be a problem, because I wasn't thinking that with each postback, my table would just be re-created, therefore I won't get the modified values on submission.

I keep talking to myself but oh well...

Just to reiterate, I need help on maintaing state for a dynamically created table web control, and how to iterate through the controls that were created in that table on postback.
Dear Forum,

Hi! It's me again!

Ok, so after a little more research I found that people are suggesting the Request.Form() to collect information about the controls. Does that sound right? I guess if you can't take advantage of viewstate in this situation, then Request.Form() is the way to go.

Taking that into consideration, I don't think I can really "iterate" through the controls in my dynamic table, but maybe create some variables that will hold the number of checkbox controls say, when I create the table. So maybe it would look something like this:

pseudocode -
' Creating the table
Dim cb as CheckBox
Dim cbCounter as Int32
'Dynamically create checkbox here and increment the checkbox counter

Then later when I retireve the values within my table...

'Go through each of the checkboxes and determine the value
for x=0 to cbCounter.Length - 1
'check the value of checkbox "x" here

Does this sound like a logical resolution? Am I taking this too far and there is an easier path that I'm missing here? Does anyone really care at this point? :)
Hi FrankWhite,

I'm having the same problem here. I'm fetching values from a MySQL database, I show them in a nice table with checkboxes. But when the user clicks "submit" my checkboxes are lost (since my table won't keep them).
So I'm looking for the same solution: how can I keep all generated checkboxes, so I can check which of them are checked by the user?

If someone has experience with this scenario and knows how it can be done, please post it here for me and FrankWhite ;)

Thanks in advance!
1. Try to stay away from dynamically creating controls that need to keep their values during postbacks.

2. Modify the way you search for information. More than 50% of programming involves just trying to find out how to do stuff. Your problem is not with viewstate, but with the ASP.NET lifecycle.

To answer both your question, you will need some patients.This article will answer your questions, but you have to read every word carefully. DONT skip to the end and read the conclusion as you will miss out on important things that you should learn.

Jagdip
(Haven't read the article yet)

I did come to a solution the other day. Basically on Page_Load my table is recreated everytime. When the submit button is pressed, I simply do Request.Form() on the checkbox controls. I don't have the code in front of me at the moment, but I basically did the following to solve my problem.

1.) Created a variable that would serve as a counter for my checkboxes.
2.) When the checkbox was created, I would give it the id: "chk_" & chkCtrls (variable that was the counter)
3.) In the btn_submit() I created a loop to iterate through each of the checkbox controls (well not really the controls, rather the # of controls). In the loop I would check if the checkbox was checked and do something according to that:

for x = 0 to chkCtrls
if Request.Form("chk_" & x) = "On" Then
'do something
end if
next

There was a lot more to it then this for my situation, but I think this will give you a good idea. Let me know if this helps, or if you figured out a different solution. In the meantime, I'll need to peep this article...
I used the same solution, I recreated my checkbox collection each time in Page_load, and used Request.Form to check wether the "check all" was checked or unchecked to set a default checked value on each checkbox (true/false). Then on the submit button I used Request.Form again to check the status of each generated checkbox by checking for controls like "chk" + intID.
This does the trick I needed very well.

I'll take a look at the article as well, in case this is not the right way of programming this :)

Thanks for the help,
Speerman
Alright, alright, I'll give you the jist of it. I'm not an expert in this (just been reading around a lot) so here goes.
Basically, the ASP.NET life cylce loads your info like this:

Page_Init
Load ViewState
Page_Load
Run any controls functions (e.g. button_click functions, etc.)

From this you can see that if you create controls dynamically, then they will be displayed on the page; but their viewstate will not be 'loaded'. What we need is a way to create the controls before the Load Viewstate state.

Solution: If you are using VS, the you know there is a region called " Web Form Designer Generated Code ". In this you will find:


'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

All you need to do is call the function that creates the dynamic controls from within the Page_Init function. That's it (i think - havent got a chance to try it).

But please, read the article. You will have a better understanding of ASP.NET which means better pages (and maybe a pay rise - you can tell why I read the aticles ;-)

HTH
Jagdip