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