On Wed, Feb 3, 2010 at 2:26 AM, Guenter Milde <[email protected]>wrote:

> On 2010-02-02, Mark Harrison wrote:
> > This came up in the course of generating some REST formatted tables:
>
> > select foo,bar from baz;     select foo from baz;
>
> > === ===                       ===
> > foo bar                       foo
> > === ===                       ===
> >   1   2                         1
> >   3   4                         3
> > === ===                       ===
>
> > Of course, the single-column select results looks the
> > same as a section header.
>
> > Is there any escape sequence or other magic I can add to simple table
> > to make sure this doesn't happen?  It would be nice if it applied to
> > multi-column tables as well, so I wouldn't have to check in my code if
> > this were a single-column special-case.
>
> Use the grid table markup::
>
>  +------------------------+
>  | Header row, column 1   |
>  | (header rows optional) |
>  +========================+
>  | body row 1, column 1   |
>  +------------------------+
>  | body row 2             |
>  +------------------------+
>  | body row 3             |
>  +------------------------+
>  | body row 4             |
>  +------------------------+
>
> See
> http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#tables
>
> Maybe we need a more prominent note that the standard RST markup language
> is documented at the Docutils site.
>
> Günter
>
>
>
And since you're generating tables, you might take a look at:
http://commandline.org.uk/python/restructuredtext-tables-and-doctests/

and a modified version which handles multiline cells here:
http://bitbucket.org/khorn/lore2sphinx/src/tip/table.py

Kevin Horn

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" 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/sphinx-dev?hl=en.

Reply via email to