Saturday, March 31, 2012
Table Rows
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
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
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
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
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
<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.LoadIf Session("userid") <> "" Then
DropDownList1.Visible = True
Else
DropDownList1.Visible = False
End IfEnd 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 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
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
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
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.
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
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
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
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
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
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
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 = heightscell.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
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
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
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:
>