Empty raw in a grid table

9 views
Skip to first unread message

Vladimír Marek

unread,
Aug 8, 2022, 7:13:33 AMAug 8
to sphinx-users
Hi all,

I would like to ask if it is somehow possible to enforce an empty raw in
a grid table.

Simple example
+--------+-------------+
| text  | text text |
|          |                 |
|          |THIS        |
+--------+-------------+

and I would like to have:
text text
<empty visible raw>
THIS

If I left there empty line then in generated output (pdf) there was no
empty line.
How can I achieve this?

Thanks,
  Vladimir

Jim Kennedy

unread,
Aug 8, 2022, 8:34:25 AMAug 8
to sphinx...@googlegroups.com
Hi Vladimir,

If you build your table like this it should work in pdf also:

.. list-table:: Simple Example
   :widths: 40 60
   :header-rows: 1

   * - head 1
     - head 2
   * - text
     - text text
   * -
     -
   * -
     - THIS


--
You received this message because you are subscribed to the Google Groups "sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/d9ba75c5-5688-46ea-82eb-2293d5164c8a%40frafos.com.

Vladimír Marek

unread,
Aug 8, 2022, 9:52:14 AMAug 8
to sphinx...@googlegroups.com
Hi Jim,

thanks for the tip but unfortunately I'm bind to the grid format (using that structure I sent before).
In mean while I found that I can add a new line like this:

Simple example
+--------+-------------+
| text  | text text |
|          |                 |
|          | | THIS    |
+--------+-------------+

but it also generates a new line after the "THIS" which is something I really don't want :-(

V.

Jean Abou Samra

unread,
Aug 11, 2022, 9:10:50 AMAug 11
to sphinx...@googlegroups.com, Vladimír Marek


Le 08/08/2022 à 15:52, Vladimír Marek a écrit :
> Hi Jim,
>
> thanks for the tip but unfortunately I'm bind to the grid format
> (using that structure I sent before).
> In mean while I found that I can add a new line like this:
> Simple example
> +--------+-------------+
> | text  | text text |
> |          |                 |
> |          | | THIS    |
> +--------+-------------+
>
> but it also generates a new line after the "THIS" which is something I
> really don't want :-(
>
> V.


I'm not sure what can force you to use this table format, but
this works for me, unless I have misunderstood the request:

+--------+-------------+
| text   |  text text  |
+--------+-------------+
|        |             |
+--------+-------------+
|        |     THIS    |
+--------+-------------+


Best,
Jean

Vladimír Marek

unread,
Aug 12, 2022, 2:04:48 AMAug 12
to Jean Abou Samra, sphinx...@googlegroups.com
Hi Jean,

it's easy. The documentation which I need to update is written with the
grid format and I don't want to introduce there such a change.

Your suggestion adds a whole new raw into a table but I need to add a
new line just in text inside one cell ...

Regards,
  Vladimir

Jean Abou Samra

unread,
Aug 12, 2022, 3:16:34 AMAug 12
to Vladimír Marek, sphinx...@googlegroups.com
Le 12/08/2022 à 08:04, Vladimír Marek a écrit :
> Hi Jean,
>
> it's easy. The documentation which I need to update is written with
> the grid format and I don't want to introduce there such a change.
>
> Your suggestion adds a whole new raw into a table but I need to add a
> new line just in text inside one cell ...

Well, for me a 'row' is a table row :-)

Try this:

+-----------+------------------+
|  text     | | text text      |
|           | |                |
|           | | THIS           |
+-----------+------------------+



See the documentation about "line blocks" here:
https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#lists-and-quote-like-blocks

Vladimír Marek

unread,
Aug 12, 2022, 3:59:50 AMAug 12
to Jean Abou Samra, sphinx...@googlegroups.com
I tried that as well already but it adds empty line at the top and
bottom of whole text block which is something I don't want
I just want a simple one empty line between text :-)

Steevie

unread,
Aug 12, 2022, 4:42:22 AMAug 12
to sphinx...@googlegroups.com
Hi,

On Fri, 12 Aug 2022 09:59:44 +0200, Vladimír Marek wrote:

> I tried that as well already but it adds empty line at the top and
> bottom of whole text block which is something I don't want I just want a
> simple one empty line between text :-)
untested but it should work:

+-----------+------------------+
|  text     | | text text      |
| \         | | \              |
|           | | THIS           |
+-----------+------------------+

(escape an empty space)

To add 2cents: I'd also suggest to switch to other, more maintainable types
of tables, csv-table:: being my favourite: It will take some time for the
conversion, but it'll save you lot of time with maintenance later.

HTH,
Stefano


Reply all
Reply to author
Forward
0 new messages