473,791 Members | 2,725 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.dt d">
<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="Wh ite" BorderStyle="So lid" 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;bor der-width:1px;borde r-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 1873
Mark,

Did you try simple

tblCart.Attribu tes["align"]="center"; ?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Mark Rae" <ma**@markNOSPA Mrae.comwrote in message
news:OJ******** ******@TK2MSFTN GP02.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.dt d">
<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="Wh ite" BorderStyle="So lid" 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;bor der-width:1px;borde r-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.orgwro te in
message news:On******** ******@TK2MSFTN GP02.phx.gbl...
Did you try simple

tblCart.Attribu tes["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**@markNOSPA Mrae.comwrote in message
news:%2******** *********@TK2MS FTNGP02.phx.gbl ...
"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:On******** ******@TK2MSFTN GP02.phx.gbl...
>Did you try simple

tblCart.Attrib utes["align"]="center"; ?

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

Nov 5 '06 #4
"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:%2******** ********@TK2MSF TNGP02.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
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
1741
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
1322
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 int cnt = Products.Count; string key = ""; Control c; TableRow r = new TableRow();
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...
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
0
989
by: ivanfe | last post by:
Hi, I did not find a way to paging a <asp:Table> someone konws ? Thanks...
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
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10426
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...
1
10154
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
9993
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
5430
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4109
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
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.