[go: up one dir, main page]

Page MenuHomePhabricator

Tables don't support the "nowrap" cell attribute
Closed, ResolvedPublic

Description

Author: dr.burnett

Description:
Adding "nowrap" to a table cell or row should force the browser to not wrap
lines at spaces. However, media wiki ignores these. For example, putting this
in an article:

{| width="50"

-
nowraphello world
}

<TABLE width="50">
<TR nowrap>

<TD nowrap>hello world</TD>

</TR>
</TABLE>

will generate the following HTML:

<table width="50">
<tr>
<td>hello world</td>
</tr>
</table>
<table width="50">
<tr>
<td>hello world</td>
</tr>
</table>

which is clearly missing the nowrap attribute. The only way to actually force
this is to replace all spaces with the "& nbsp ;" equivalent, which is nothing
short of a hack.


Version: unspecified
Severity: normal
Platform: PC

Details

Reference
bz1920

Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:20 PM
bzimport set Reference to bz1920.
bzimport added a subscriber: Unknown Object (MLST).

The nowrap attribute is deprecated in HTML 4[1], and since we don't already support it we probably aren't going to add it.

Have you tried the equivalent CSS bit[2]?
Something like style="white-space:nowrap" should do it.

[1] http://www.w3.org/TR/html4/struct/tables.html#adef-nowrap
[2] http://www.w3.org/TR/CSS2/text.html#white-space-prop

Actually, the updated HTML sanitizer code in 1.5 already allows this attribute. Resolving FIXED.

epriestley added a commit: Unknown Object (Diffusion Commit).Mar 4 2015, 8:15 AM