[pmwiki-users] proposed markup for rowspan in simple tables

Patrick R. Michaud pmichaud at pobox.com
Mon Aug 25 07:48:09 CDT 2008


On Mon, Aug 25, 2008 at 10:44:46AM +0200, Christian Ridderström wrote:
> What about this:
>
> ||cell text ||__spanning text ||
> ||text      ||__more spanning text ||
> ||more      ||__last row of spanning text ||
> ||aaa       ||bbb ||
>
> Here you don't specify the number of rows explicitly, but instead place  
> '__' on each row that's to be included. To me, the advantage is more 
> space for the spanning text.

I like this as well, but it has the distinct drawback that the
markup engine would have to "look ahead" to determine the number
of rows to be spanned and to find the complete text of the
current cell, and then remember not to re-render that text
in subsequent rows.  Doing that might be a bit tricky.

> Perhaps tables really require more of a WYSIWYGI approach?  I think the
> recipe http://www.pmwiki.org/wiki/Cookbook/TableEdit improves this quite  
> a bit. Note that table edit only works with the (:table:)..-markup.

As long as the table markup that is produced/consumed is still
readable/writable by human editors, I think this approach could be
okay.  One of the common issues with WYSIWYG editors is that they
effectively prohibit non-WYSIWYG approaches.  For example, does TableEdit
understand (and preserve) all of the table options that might exist
in a manually generated table?  Or do some of the properties get
lost?

> (:simpletable separator=";" alignment="llc" :)
> Column A ; Column B  ; Column C
> asfasdf  ; asdfasdf  ; asdfas
> afasdff  ;
> (:simpletableend:)

I like this approach a lot -- I'll have to think about it.
It might even be do-able within the existing table markup, as
something like:

|| separator=";" alignment="llc"
|| Column A ; Column B ; Column C
|| apple    ; banana   ; cherry
|| ask      ;

Or, perhaps combine separators and alignments in a single format string,
allowing the separator to change:

|| format="l ; l - c"
|| Column A ; Column B - Column C
|| apple    ; banana   - cherry
|| ask      ;          -

> Perhaps it might even be possible to use multiple spaces as column  
> separator, thus allowing:
>
> (:simpletable separator="  " alignment="lcr" :)
> Column A    Column B     Column C

... how would one specify an "empty" cell?

> Or perhaps use a tab character.

In general it's a bad idea to use tab characters, because (1) they
tend to misalign things anyway, and (2) they're invisible in the
editor.

Pm



More information about the pmwiki-users mailing list