Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > <asp:table> problems

Reply
Thread Tools

<asp:table> problems

 
 
Dave Bennett
Guest
Posts: n/a
 
      07-15-2004
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
http://www.velocityreviews.com/forums/(E-Mail Removed)




 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      07-15-2004
"Dave Bennett" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving the web, charset problems and symbols problems Sak Na rede Ruby 0 01-30-2009 05:05 AM
Problems, problems for newbie Shelly ASP .Net 1 09-03-2007 02:10 AM
Problems compiling simple C++ code (also problems with std::string) Susan Baker C++ 2 06-26-2005 01:43 AM
Re: sound problems and modem problems Harold Potter Computer Support 5 12-04-2003 04:12 PM



Advertisments