****** Tables ****** .. contents:: :local: Simple tables ============= - First column cells cannot be multiple lines - Must contain more than 1 row ======= ===== name age ======= ===== Alice 42 Bob 99 ======= ===== .. code-block:: rst ======= ===== name age ======= ===== Alice 42 Bob 99 ======= ===== Grid Table Syntax ================= .. code-block:: rst +-------+-----+ | name | age | +=======+=====+ | Alice | 42 | +-------+-----+ | Bob | 99 | +-------+-----+ Result: +-------+-----+ | name | age | +=======+=====+ | Alice | 42 | +-------+-----+ | Bob | 99 | +-------+-----+ CSV Table ========= https://docutils.sourceforge.io/docs/ref/rst/directives.html#id4 .. csv-table:: Frozen Delights! :header: "Treat", "Quantity", "Description" :widths: 15, 10, 30 "Albatross", 2.99, "On a stick!" "Crunchy Frog", 1.49, "If we took the bones out, it wouldn't be crunchy, now would it?" "Gannet Ripple", 1.99, "On a stick!" Sublime shortcuts for OSX ========================= Using the `Sublime Text rst-completion plugin `_: Grid table rst-completion ------------------------- :kbd:`Command-Shift-t`, :kbd:`Enter` https://github.com/mgaitan/sublime-rst-completion#grid-table hello world foo use 2+ spaces as a delimiter bar then do cmd-shift-t, enter +-------+------------------------------+ | hello | world | +=======+==============================+ | foo | use 2+ spaces as a delimiter | +-------+------------------------------+ | bar | then do cmd-shift-t, enter | +-------+------------------------------+ Simple table rst-completion --------------------------- :kbd:`Command-Shift-t`, :kbd:`s` https://github.com/mgaitan/sublime-rst-completion#simple-table VS Code Plugins --------------- - https://marketplace.visualstudio.com/items?itemName=shuworks.vscode-table-formatter :kbd:`Command-Shift-P` References ========== `Tables: Miscellaneous Markup, Sphinx Documentation `_ `Tables: REST+Sphinx Documentation `_ `Tables, RestructuredText Docs `_ `RST Cheatsheet: Tables `_ `Magic Tables from RST Completion Sublime plugin `_