Question

I've just noticed that tidy_repair_string() is removing my non-breaking spaces from empty elements causing my table to collapse. Basically I've put in:

<td>&nbsp;</td>

and HTML Tidy is stripping them out to:

<td> </td>

which may or may not be some Unicode break but either way it's collapsing. The only &nbsp; related option I've seen is 'quote-nbsp' but that doesn't seem to be it. I think it defaults to on anyway.

How do I keep my non-breaking spaces?

Was it helpful?

Solution

Apply this style, then you do not need to put content in the "empty" cells:

td { empty-cells: show; }

OTHER TIPS

use the "bare" config option.

more information and an explanation available here: http://osdir.com/ml/web.html-tidy.user/2004-07/msg00005.html

You could try the following:

$myString = str_replace(" ", "&nbsp;&nbsp;", $someText);

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top