Re: simple table without formatting

Guenter Milde via Docutils-users <[email protected]> Sun, 20 Feb 2022 18:30:08 -0000 (UTC)
Newsgroups gmane.text.docutils.user
Message-ID <[email protected]>
On 2022-02-20, Wols Lists wrote:

...

> Okay, done a bit of googling, ended up with this, and I've still got 
> grid lines everywhere ...

> .. table::
>     :class: borderless
>=========== =========================================================
> Item-Id -   A character string (maximum 48 characters) which
>              uniquely identifies an item within a file. The item-id
>              may include any characters except system delimiters,
>              however the use of blanks, single quotes, quotes,
>              commas, and backslash characters may require special
>              considerations.

In order to get it working this way, you need to *nest* the table in the
directive (i.e. indent it to the same amount as the second line):

.. table::
   :class:  borderless
   
   ============== ===================================================
   Item-Id -      A character string (maximum 48 characters) which
                  uniquely identifies an item within a file.
                  ...
               
    ...           ...             
   ============== ===================================================
 
In Docutils, you can easily avoid the indenting with a "prefix" class
directive:

.. class:: borderless

============== ===================================================
Item-Id -      A character string (maximum 48 characters) which
               uniquely identifies an item within a file.
               ...
            
 ...           ...             
============== ===================================================

In Sphinx, the "class" directive is used for other purposes by default
and must be activated in the setup.py config file.

You can also set a default class for all tables in a document with
the table_style configuration setting.
https://docutils.sourceforge.io/docs/user/config.html#table-style
This should work in Docutils and Sphinx.


Instead of a table, you may use lists:

A definition list
https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#definition-lists

Item-Id -      
  A character string (maximum 48 characters) which uniquely identifies an
  item within a file. ...
            
...
  ...             
  
or a field list  
https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#field-lists

:Item-Id: A character string (maximum 48 characters) which uniquely identifies an
          item within a file. ...
:...:     ...             

The layout/formatting of the lists can be customized in a stylesheet.


Hope this helps a bit.
Güner




_______________________________________________
Docutils-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.