Hi Peggy
On 28/09/10 12:13, Peggy Russell wrote:
Hi Stuart:
I was testing Asciidoc tables to accommodate a project, and ran into something
strange.
Bottom line:
Can table column spanning be used on a table that uses an alternate separator?
A specific example is shown below.
Table one is the basic table and the table is formed correctly.
Table two, I only added what I thought was the default separator
(Doc #: 19.2), but the table was malformed. I was a little surprised by this.
I must be missing something. I actually tried this as a baby-step after the
Table three test failed, but I thought it made more sense to put it as
Table two for the sake of this explanation.
The PSV separator is a Python regular expression that captures the cell
specifier parameters, here's the default:
((?<!\S)((?P<span>[\d.]+)(?P<op>[*+]))?(?P<align>[<\^>.]{,3})?(?P<style>[a-z])?)?\|
If you put it in the table attributes list you also need to escape backslashes,
double-quotes etc. This will work:
[width="20%",cols="<.^2literal,<.^8default",frame="all",options="",caption="",separator="((?<!\\S)((?P<span>[\\d.]+)(?P<op>[*+]))?(?P<align>[<\\^>.]{,3})?(?P<style>[a-z])?)?\\|"]
You could use a plain | separator="\\|" but you wouldn't get any cell specifier
functionality.
See also:
http://www.methods.co.nz/asciidoc/userguide.html#X69#
I've cc'd this to the AsciiDoc discussion list as it's a point which the manual
doesn't really cover.
Cheers, Stuart
Table three, I only changed the separator to something else (doesn't
appear to matter), but the column spanning was ignored.
.(1) Simple table - Ok start
[width="20%",cols="<.^2literal,<.^8default",frame="all",options="",caption=""]
|=======================================================================
| A | Some text A
2+^|
| B | Some text B
2+^|
| C | Some text C
|=======================================================================
.(2) Add default separator - Causes malformed table
[width="20%",cols="<.^2literal,<.^8default",frame="all",options="",caption="",separator="|"]
|=======================================================================
| A | Some text A
2+^|
| B | Some text B
2+^|
| C | Some text C
|=======================================================================
.(3) Changed separator value - Doesn't obey cell spanning
[width="20%",cols="<.^2literal,<.^8default",frame="all",options="",caption="",separator="!"]
|=======================================================================
! A ! Some text A
2+^!
! B ! Some text B
2+^!
! C ! Some text C
|=======================================================================
I'm running asciidoc 8.6.0.
Thank you.
Peg Russell
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.