473,781 Members | 2,491 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<asp:table> problems

I am hoping someone can help me because I am really beginning to hate IE.

I am using the following code to generate a dynamic table.
private void buildTable(Arra yList Products)
{
//Variables
int cnt = Products.Count;
string key = "";
Control c;
TableRow r = new TableRow();
TableCell Xcell = new TableCell();

//Add Empty cell
Xcell.Width=Uni t.Parse("100");
r.Cells.Add(Xce ll);

//Build Product Titles
for (int i=0;i<cnt;i++)
{
TableCell cell = new TableCell();
cell.CssClass=" whiteSub";
cell.Width=Unit .Pixel(125);
Label lbl = new Label();
lbl.ID = "Prod" + (i+1) + "_Nm";
cell.Controls.A dd(lbl);
r.Cells.Add(cel l);
}
ProdName.Rows.A dd(r);
}

When I render in IE it puts the width inside a style tag which I do not
want. See below for example of rendered HTML.

<table id="ProdName" cellspacing="2" cellpadding="2" border="0">
<tr>
<td style="width:10 0px;"></td>
<td class="whiteSub " style="width:12 5px;"><span
id="Prod1_Nm">x xxx</span></td>
<td class="whiteSub " style="width:12 5px;"><span
id="Prod2_Nm">x xxx</span></td>
<td class="whiteSub " style="width:12 5px;"><span
id="Prod3_Nm">x xxx</span></td>
</tr>
</table>
In Mozilla Firefox it renders it correctly. See below for example of
rendered HTML

<table id="ProdName" cellspacing="2" cellpadding="2" border="0">
<tr>
<td width="100"></td>
<td class="whiteSub " width="125"><sp an id="Prod1_Nm">x xxx</span></td>
<td class="whiteSub " width="125"><sp an id="Prod2_Nm">x xxx</span></td>
<td class="whiteSub " width="125"><sp an id="Prod3_Nm">x xxx</span></td>
</tr>
</table>

Can anyone tell what I need to do to make IE render the <ASP:Table>
correctly?
Thanks in advance

Dave Bennett
da**********@ca pbluecross.com


Nov 18 '05 #1
1 1321
"Dave Bennett" <da**********@c apbluecross.com > wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I am hoping someone can help me because I am really beginning to hate IE. <snip> Can anyone tell what I need to do to make IE render the <ASP:Table>
correctly?


Sorry, what's wrong with the way the table is rendering? What's wrong with a
style attribute?
--
John Saunders
johnwsaundersii i at hotmail
Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1630
by: Drew Pawlik | last post by:
Hey guys, I'm having a problem and need some help. I have an <asp:table ...> in my web page, and this table has 2 rows, the first being a header row, and the second row containing an <asp:button> to add rows to the table. Well, when I add the first row it shows up, but if I try to add any more rows, the one I added + the rest of them all disappear. I tried saving the table to a Session variable, but that didn't work. I'm not really sure...
1
1740
by: Ed. | last post by:
I apologize if this is a stupid question. When working with the <asp:Table> component in design mode, how do you select controls placed in the table cells? I can only seem to click on the table itself rather than the individual components within the cell. Also, what's the advantage of using <asp:Table> rather than just a simple <Table>? Thanks.
0
1331
by: Bryan Donaldson | last post by:
I have a table on my web form, declared like this: <asp:table id="tblOverrides" runat="server" enableviewstate=true" cssclass="clsTable"> <asp:tablerow cssclass="clsTblHeader"> <asp:tablecell Text="label" id="hdrLabel"></asp:tablecell"> <asp:tablecell Text="ddl" id="hdrDDL"></asp:tablecell"> </asp:tablerow> </asp:table> -----------------------------------------------------------------------
5
2103
by: Ken Dopierala Jr. | last post by:
Hi, This is just a query about what people use most. Up until today I've been using <asp:Table> tags to build my tables. We just outsourced our HTML design to a local guy and when I got it back today I was working with the html <table> <tr> <td> etc. What a difference that makes, server controls are even automatically declared in the code behind when using the generic HTML controls. I think I'm going to switch over to using them...
1
6854
by: Rob Meade | last post by:
Hi all, I recently read a book regarding improving the performance of web pages loading, one of the suggestions was to add <colgroup> and the relevant <col> tags with information such as cell widths and so on. Having understood how this works and what it can do I was keen to apply it this morning to a .net application - my problem is that I have an <asp:table> and it wont allow me to add <colgroup> tags etc between the opening and...
2
1401
by: Roy | last post by:
Hey all, Quick question here. Within VS.NET there are various tags such as <asp:Table>, <asp:TableCell>, etc... which can be used in lieu of <Table>, <td>, etc... Why do such replacement tags exist? Do they convey any inherent advantage over the old ones? Thanks!
3
8250
by: Andy | last post by:
Hi folks, I have a customvalidator control that works properly if it isn't contained in an ASP:TABLE. But, when I place it inside an ASP:TABLE, I find that _ServerValidate doesn't get fired, even if I force the customvalidator to validate by invoking its validate() method after a button is clicked: cvCustomValidator_ServerValidate(object source, system.Web.UI.WebControls.ServerValidateEventArgs args) <== doesn't get
4
1873
by: Mark Rae | last post by:
Hi, Consider the following: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > .... .... ....
1
1690
by: ckb | last post by:
Hi, This bit of code throws error Expected End of statement at line1 <asp:Table Width="100%" > <asp:TableRow id="T2r1"> <asp:TableCell id="T2r1c1" Width="85%"> <asp:PlaceHolder ID="PlaceHolder1" runat="server">Control Not Loaded</asp:PlaceHolder> </asp:TableCell> </asp:TableRow> </asp:Table> where line1 is actually
0
10308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10143
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10076
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9939
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8964
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7486
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5507
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4040
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.