Recent Changes · Search:

Support the Project

Wikipublisher

PmWiki

edit SideBar

 

Column Span: Using colspan in advanced tables

Does Wikipublisher support the colspan attribute in advanced tables? How do I take advantage of this?


Part of a decorative border

Normally, Wikipublisher wraps the contents of advanced table cells in a LATEX minipage. However, only simple text strings (no paragraphs) can span columns in LATEX tables. So unless we do some special processing to work out whether or not to honour a cell colspan directive, LATEX could die with an error.

Column spans in advanced tables illustrates the markup in practice.

This text spans 2 table columns This does not span
First column Second column Third column

This is a wrapped cell
Prevented from spanning
But only in the PDF!

This does not span
And the break is masked

So what exactly happens in this example?

By placing cell contents on the same line as a (:cell:) directive, we are telling Wikipublisher to treat this as a simple string of text, which can span 2 or more columns. By starting the cell contents on the line following a (:cell:) directive, we are telling Wikipublisher to treat the contents as a text block. In this case, if the (:cell:) directive contains a colspan attribute, Wikipublisher will insert a “dummy” cell containing “…”.

This is the relevant source for the table:

(:cellnr colspan=2:)This text spans 2 table columns
(:cell:)This does not span
(:cellnr:)First column
(:cell:)Second column
(:cell:)Third column
(:cellnr colspan=2:)
This is a wrapped cell\\
Prevented from spanning\\
But only in the `PDF!
(:cell:)This does not span\\
And the break is masked

In addition, LATEX does not allow the \\ break markup in simple cell text. So Wikipublisher treats the last cell as a text block and prints it inside a minipage.

Category: markup

« 00055 · Edit Form · 00057 »

Creative Commons License
Edit · History · Print · Recent Changes · Search · Links
Page last modified on 17 March 2010 at 04:24 AM