Forum How do I...?

XML Tables and spanning

ddeyen
I have been using Prince for the last few months to take documentation out of MS Word and into a format that allows CSS to take care of the formatting.

I have been having some problems with tables, specifically tables spanning multiple rows, columns, etc.


here is some sample code: (keep in mind my source is XML NOT html. i am merely using the same names as html to follow the prince documentation easier.

<table>
<th>Test Table</th>
<tr>
<td>A</td><td>B</td><td>C</td>
</tr>
<tr>
<td>X</td><td>Y</td>
</tr>
</table>

and my stylesheet.

table                {display: table; table-layout: fixed; width: 50%}
thead                {display: table-header-group}
tr                   {display: table-row}
td                   {display: table-cell; border: solid 1px black}
td.colspan2          {column-span: 2 }

Y should span accross the margin of both B and C but sadly. stays with B and there is a blank space underneath C. essentially what I am trying to represent is that Y applies to both B and C.

Any help would be appreciated.
kmmv
Try pasting your sample code again and check "Disable HTML in this post".
mikeday
This is probably because the property for spanning multiple table columns has been renamed to "table-column-span", to avoid any confusion with a future property for spanning text columns in multiple column layouts.
ddeyen
Is it possible to just link to an HTML table inside of my XML file and have prince include that file in the printed PDF.

if so how would I do this.

I have used xincludes to build a master file list (each section of my document is a seperate.xml file) but never used them (or whatever will work) inside of an XML document.

Appreciate all the help.
mikeday
I don't think it's possible to load HTML with XInclude, although it is possible to load XHTML. Do you want to load the entire file, or just part of it? The xpointer attribute can be used to include a portion of an XML document.
ddeyen
Im thinking of just putting my tables outside of the xml document in a seperate xhtml file for each table and having xincludes include them in the XML file when prince creates the PDF.

is that possible?
mikeday
Yes, that should work fine.