Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datalist and css styling

Status
Not open for further replies.

davikokar

Technical User
May 13, 2004
523
IT
hallo,

I was wondering about why the datalist control will always add some styling tags, like:

cellspacing="0"
border="0"
style="border-collapse:collapse;"

even though I don't set any styling. I'm used to work with external stylesheets and this kind of styling are not even xhtml compatible, at least the two:
cellspacing="0" and border="0".

Is there a way to avoid any default styling?

thanks
 
These are the default outputs for the DataList's properties like Cellpadding, Cellspacing and GridLines. Unfortunately you cannot turn these off as such. The outout from most 1.1 ASP.NET controls is not XHTML compliant. Fortunately the ASP.NET team have said they have made all controls output XHTML compliant source for ASP.NET 2.0 :)

In the meantime if you want to do anything more than trivial with ASP.NET and maintain XHTML compliance you are looking at either redevloping your own XHTML compliant controls or buying in a 3rd party control suite.

In your particular situation as you can define all output from a Repeater control this may be just what you need to get the markup you want.

All depends on the old time/money/standards compliance conundrum... I want it compliant, the client appreciates the benefits (or at least nods when you explain them) but really (like all other clients) only actually cares when they can have it, how much it will be and of course what it LOOKS like, not what it does or how it does it! ;-)

Rob

i'm a boy, called Bert, and I may not be crazy, but if i'm not the rest of you are...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top