csv-table reference as table number rather than table name
-
17-03-2021 - |
Question
I am making a document with many tables. But, the only way I know how to refer to them in the text is with a :ref:'my_table'
and that puts the entire table name, "The long title of my table" in my text block. I would rather have it put in "Table 1.3" instead ... is that possible?
.. _my_table:
.. csv-table:: The long title of my table
:file: my_table.csv
:header-rows: 1
A separate but table related questions: is there a sphinx/docutils option for putting the table name/caption at the bottom rather than the top or is that a stylesheet/latex thing?
Solution
There's probably not a super-easy way to do this, but the numfig extension (as referenced in this question) does something very like this for Figures, and could probably be modified/adapted to do something similar for Tables.
A custom extension like this is probably the only way to accomplish this at present.