Menu

#48 Add :align: option to the table directives (table, csv-table and list-table)

Default
closed-fixed
nobody
None
5
2017-02-04
2016-02-22
No

The rst2html command puts the tables to left of pages.
It would be nice if we are able to align these to arbitrary position.

Here's patch for the table directives take :align: option like figure directive.

1 Attachments

Discussion

  • Günter Milde

    Günter Milde - 2016-02-26

    You can pass the align-... class value to any object via the "class" directive. Styling with CSS should then be easy.

     
  • Takeshi KOMIYA

    Takeshi KOMIYA - 2016-03-04

    Using CSS is fine, but we have to prepare CSS to align tables to center always.
    I think aligning tables are common feature (mainly centering).
    At the same time, it is useful for LaTeX and other writers too.
    My patch including the fix for LaTeX's.
    The class directive does not effect these writers I believe.

    Are there any chance to add the option?

     
  • Andrea Cassioli

    Andrea Cassioli - 2016-03-07

    Hi,
    just to elaborate a bit on the issue:

    1. Despite using CSS is an easy fix, for more general uses it might be not that simple. As Takeshi said, if the target format is Latex one may need to have some information to decide the table alignement.

    2. In terms of readability an explicit mention to the table alignement is a plus.

    3. Such an option would also make figure and table behave in a more similar way.

     
  • Günter Milde

    Günter Milde - 2016-05-27

    I agree that this as an addition that nicely fits in.
    For a complete patch, we would need test cases and a documentation update.

     
  • Takeshi KOMIYA

    Takeshi KOMIYA - 2016-05-28

    I'm grad to hear that. I updated the patch including testcases and documentation.
    Could you review this please?

     
  • Günter Milde

    Günter Milde - 2016-07-26
    • status: open --> pending
     
  • Günter Milde

    Günter Milde - 2016-07-26

    Thanks for the update. I completed support for list tables, added some more tests and adapted the documentation.
    Committed in 7952. Please test.

    Still missing is an update of the Docutils DTD http://docutils.sourceforge.net/docs/ref/docutils.dtd adding the align option to tables.

     
  • Günter Milde

    Günter Milde - 2017-02-04
    • status: pending --> closed-fixed
     
  • Günter Milde

    Günter Milde - 2017-02-04

    The change is now complete. Please reopen if there are problems.
    Thank you for the suggestion and patch.

     

Log in to post a comment.

MongoDB Logo MongoDB