Page MenuHomePhabricator

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


Author: dr.burnett

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>


will generate the following HTML:

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

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



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.


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