473,399 Members | 2,478 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,399 software developers and data experts.

Possible XHTML bug with <asp:Table> tag and HorizontalAlign property

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" >
....
....
....
<asp:Panel ID="pnlCart" Runat="server" HorizontalAlign="Center">
<asp:Table HorizontalAlign="Center" ID="tblCart" Runat="server"
BorderColor="White" BorderStyle="Solid" BorderWidth="1" GridLines="Both">
<asp:TableRow>
...
</asp:TableRow>
<asp:TableRow>
...
</asp:TableRow>
<asp:TableRow>
...
</asp:TableRow>
<asp:Table>
<asp:Panel>

That produces the following HTML:

<div id="pnlCart" style="text-align:center;">
<table id="tblCart" align="Center" rules="all" border="1"
style="border-color:White;border-width:1px;border-style:Solid;">
<tr>
....
</tr>
<tr>
....
</tr>
<tr>
....
</tr>
</table>
</div>

This fails validation through http://validator.w3.org/ because of the
capitalisation of "Center" in align="Center". Even changing the <asp:Table
tag to spell it with a lower-case "c" i.e. HorizontalAlign="center" still
renders the HTML with a capital "C".

I don't want to use a textalign style, as that will center all the text
within the individual tablecells.

Has anyone else noticed this? Is there a way round it to pass XHTML
validation?

Any assistance gratefully received.

Mark
Nov 5 '06 #1
4 1852
Mark,

Did you try simple

tblCart.Attributes["align"]="center"; ?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:OJ**************@TK2MSFTNGP02.phx.gbl...
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" >
...
...
...
<asp:Panel ID="pnlCart" Runat="server" HorizontalAlign="Center">
<asp:Table HorizontalAlign="Center" ID="tblCart" Runat="server"
BorderColor="White" BorderStyle="Solid" BorderWidth="1" GridLines="Both">
<asp:TableRow>
...
</asp:TableRow>
<asp:TableRow>
...
</asp:TableRow>
<asp:TableRow>
...
</asp:TableRow>
<asp:Table>
<asp:Panel>

That produces the following HTML:

<div id="pnlCart" style="text-align:center;">
<table id="tblCart" align="Center" rules="all" border="1"
style="border-color:White;border-width:1px;border-style:Solid;">
<tr>
...
</tr>
<tr>
...
</tr>
<tr>
...
</tr>
</table>
</div>

This fails validation through http://validator.w3.org/ because of the
capitalisation of "Center" in align="Center". Even changing the <asp:Table
tag to spell it with a lower-case "c" i.e. HorizontalAlign="center" still
renders the HTML with a capital "C".

I don't want to use a textalign style, as that will center all the text
within the individual tablecells.

Has anyone else noticed this? Is there a way round it to pass XHTML
validation?

Any assistance gratefully received.

Mark

Nov 5 '06 #2
"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:On**************@TK2MSFTNGP02.phx.gbl...
Did you try simple

tblCart.Attributes["align"]="center"; ?
LOL! Yes, of course - but that's hardly the point!
Nov 5 '06 #3
The point is that it could be a work-around, one of the things you've asked
for. Does it work or no?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:%2*****************@TK2MSFTNGP02.phx.gbl...
"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:On**************@TK2MSFTNGP02.phx.gbl...
>Did you try simple

tblCart.Attributes["align"]="center"; ?

LOL! Yes, of course - but that's hardly the point!

Nov 5 '06 #4
"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:%2****************@TK2MSFTNGP02.phx.gbl...
The point is that it could be a work-around, one of the things you've
asked for.
OK, I'm sorry - I didn't phrase my question clearly enough.

I was asking if the fact that the HorizontalAlign attribute of the
<asp:Tabletag generates non-compliant XHTML markup was a bug or not, and
if there was any way of persuading the <asp:Tabletag to generate
XHTML-compliant markup when using the HorizontalAlign tag.
Does it work or no?
Yes of course it does.
Nov 5 '06 #5

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: Dave Bennett | last post by:
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...
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...
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,...
0
by: ivanfe | last post by:
Hi, I did not find a way to paging a <asp:Table> someone konws ? Thanks...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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,...
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...
0
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...
0
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...

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.