Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > The nowrap Property of TD Tags

Reply
Thread Tools

The nowrap Property of TD Tags

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      05-21-2005
I want to create TD tags with the nowrap property. I have a user control
which sets the Wrap property of a TableCell to False when dynamically
creating a table as follows:

cellCurrButton.Wrap = False

When the code is run, this creates a TD tag that looks like the following:

<td nowrap="nowrap"></td>

However, when I edit the properties of a TD Tag created in Design, there is
a property called nowrap which when set to True creates a TD Tag that looks
like the following:

<td nowrap></td>

I prefer the second way because it is shorter and I also believe it is the
correct HTML. However, because the TableCell object does not have this
property, I cannot use it when creating generated TableCells. Why are these
two outputs so different? Thanks.
--
Nathan Sokalski
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Steve Goodyear
Guest
Posts: n/a
 
      05-21-2005
The first is XHTML and second is HTML 4 compatible.

Cheers,
Steve Goodyear
 
Reply With Quote
 
 
 
 
Mikhail Arkhipov (Microsoft)
Guest
Posts: n/a
 
      05-21-2005
On 5/20/05 20:49, in article (E-Mail Removed), "Nathan
Sokalski" <(E-Mail Removed)> wrote:

> I want to create TD tags with the nowrap property. I have a user control
> which sets the Wrap property of a TableCell to False when dynamically
> creating a table as follows:
>
> cellCurrButton.Wrap = False
>
> When the code is run, this creates a TD tag that looks like the following:
>
> <td nowrap="nowrap"></td>
>
> However, when I edit the properties of a TD Tag created in Design, there is
> a property called nowrap which when set to True creates a TD Tag that looks
> like the following:
>
> <td nowrap></td>
>
> I prefer the second way because it is shorter and I also believe it is the
> correct HTML. However, because the TableCell object does not have this
> property, I cannot use it when creating generated TableCells. Why are these
> two outputs so different? Thanks.


nowrap="nowrap" is better since it is compliant to modern standards like
XHTML. Standalone attributes are deprecated. In XHTML all attributes that
were previously standalone must have value equal to the attribute name.

VS 2003 is not XHTML compatible so Designer generates standalone attribute
which is OK for HTML 4. VS 2005 Designer always generates nowrap="nowrap"
since VS 2005 is XHTML compatible.

What you see at runtime is HTML generated by ASP.NET runtime. ASP.NET
controls try to generate XHTML whenever possible.

Thanks
Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights

 
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
CSS equivelant of the td tag's nowrap="nowrap" attribute Nathan Sokalski ASP .Net 3 03-28-2007 09:25 PM
nowrap not XHTML 1.0 compliant Kevin Lawrence ASP .Net 3 01-24-2006 03:38 PM
The nowrap Property of TD Tags Nathan Sokalski ASP .Net Web Controls 2 05-21-2005 04:44 PM
The nowrap Property of TD Tags Nathan Sokalski ASP .Net 2 05-21-2005 04:44 PM
TableCell oTableCell = new TableCell(); noWrap? Brian K. Williams ASP .Net 2 04-30-2004 12:04 AM



Advertisments