Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In reStructuredText, how do you make a table column have monospaced text?

I want to create a table in ReStructuredText (ReST / RST) where every column should be rendered as an inline literal / monospace font.

I can't find a way to have inline literals span multiple lines, where there is text in front of them, like a table.

Is there a way for me to set a table to render a specific column as inline literal / monospace font? If not, what is the best practice for this?

like image 845
J.W.F. Avatar asked Oct 16 '25 10:10

J.W.F.


1 Answers

Try this.

.. csv-table::
    :header: Header1, Header2, Header3

    A, B, "These lines appear as one line,
    even though they are written in two lines."
    C, D, "This is normal text. ``this is inline stuff that is very long and may wrap on multiple lines of text in a table cell, and it could look OK, but who knows?`` This is normal text again."

Yields this screenshot, using the Alabaster theme.

inline literal in a table cell

You might have to twiddle your theme's CSS to get it just right.

like image 58
Steve Piercy Avatar answered Oct 19 '25 00:10

Steve Piercy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!