How can I tabulate information in my rst files?
Or, how do I preserve the white space I already inserted in my text?
Such that when I render the rst file (via Sphinx) to HTML the tabular formatting is preserved.
For example:
- Mr Miller: Hates dogs
- Mrs Johnson: Love Cats
- Ms Janey: Owns 2 monkeys and 3 cats
I would like the text that comes after the colons to all line up.
I can’t find a “tab” character. And the white spaces in my rST file are eliminated when rendering to HTML – my output format. Also, these lines in my actual rst files are bulleted and followed by API macro code before the colon, such that the macro jumps to the correct place in the code (i.e. no text can be changed before the colon). The text after the colon is used to describe my API.
The horizontal column list directive is useless here because the text is already written left to right, and that directive splits to the second (or subsequent colummn/s) after a number of lines and not after my :. Secondly, it only recognizes bulleted lists.
I tried using a table list directive – but I don’t want the text in a table. Alternatively, I could use this directive if I knew how to hide the lines and the alternate row shading for only this type of table (i.e. other tables within the project would have to retain the table formatting already defined for our particular Sphinx project.
oz613 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.