Problem w. Tables in Author Mode, CSS attrib white-space:pre

Having trouble installing Oxygen? Got a bug to report? Post it all here.
mxrenkin
Posts: 3
Joined: Fri Mar 06, 2009 2:08 am

Problem w. Tables in Author Mode, CSS attrib white-space:pre

Post by mxrenkin »

I reduced the problem to the following simple example, where a html table is simulated in XML. Using "white-space:pre" in the CSS-file is causing the problem:

==== XML-File Begin ====

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="Test.css" type="text/css"?>
<AA>
<BB>
<TABLE>
<TR>
<TD>
Some Cell Content
</TD>
<TD>
Other Cell Content
</TD>
</TR>
</TABLE>
</BB>
</AA>
==== XML-File END ====


==== Style Sheet file "Test.css" Begin ====

Code: Select all


BB { display:block;  /*  white-space:pre; */   
border-style:solid; border-color:green; }
TABLE { display:table; border-style:inherit; }
TR { display:table-row; border-style:inherit; border-color:gray; }
TD { display:table-cell; border-style:inherit; border-color:inherit; }
==== Style Sheef file "Test.css" End ====


Switching to author mode is working well now. But as soon as you remove the comment tags from "white-space:pre;", the table cannot be displayed any more in author mode and an error is shown.

In my (non-expert) opinion this is a bug. Thanks for any feedback!
Radu
Posts: 9438
Joined: Fri Jul 09, 2004 5:18 pm

Re: Problem w. Tables in Author Mode, CSS attrib white-space:pre

Post by Radu »

Hi,

Setting white-space:pre; on the BB means that all white spaces inside the element and its descendant elements (like TABLE, TR, TD) become significant and this means they have to be presented in order to be edited by the user.

This means it is no longer possible to render the table correctly as there is significant content between the table cells and table rows which needs to be somehow presented for editing.

Indeed a browser presents the XML as a table by ignoring some of the indentation between cells but as an editor we cannot behave in the same manner, so in order to present the content the table is broken.

The solution would be to use the white-space:pre; only for the cells content. If you still want to keep this preserve on BB then you have to override and set it to white-space:normal; for TABLE and then set them again to white-space:pre; for TD.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply