473,395 Members | 1,452 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

<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(ArrayList Products)
{
//Variables
int cnt = Products.Count;
string key = "";
Control c;
TableRow r = new TableRow();
TableCell Xcell = new TableCell();

//Add Empty cell
Xcell.Width=Unit.Parse("100");
r.Cells.Add(Xcell);

//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.Add(lbl);
r.Cells.Add(cell);
}
ProdName.Rows.Add(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:100px;"></td>
<td class="whiteSub" style="width:125px;"><span
id="Prod1_Nm">xxxx</span></td>
<td class="whiteSub" style="width:125px;"><span
id="Prod2_Nm">xxxx</span></td>
<td class="whiteSub" style="width:125px;"><span
id="Prod3_Nm">xxxx</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"><span id="Prod1_Nm">xxxx</span></td>
<td class="whiteSub" width="125"><span id="Prod2_Nm">xxxx</span></td>
<td class="whiteSub" width="125"><span id="Prod3_Nm">xxxx</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**********@capbluecross.com


Nov 18 '05 #1
1 1290
"Dave Bennett" <da**********@capbluecross.com> wrote in message
news:%2****************@TK2MSFTNGP09.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
johnwsaundersiii at hotmail
Nov 18 '05 #2

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

Similar topics

0
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>...
1
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...
0
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 ...
5
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...
1
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...
2
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...
3
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,...
4
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...
1
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"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...

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.