I've tried a few things in the stylesheet and have messed around with overriding the _align() method in Flowable, but I am not having much success.
\nIs there anything that could be done to to achieve this? I appreciate that custom centering like this may be a niche request, so I would understand if this is beyond the capabilities of rinohtype at the moment.
\nAny advice would be greatly appreciated 😄
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"I can see merit in supporting this, but I'm not convinced rinohtype should provide extra style properties for such a specific case...
\nYou can however achieve this with some more manual intervention by defining a wide table style definition for which you set a left margin of -2cm. This wide table style should match tables for which e.g. the wide class is set.
\nI haven't tested this, but it should be a good start:
\n[wide table : Table(has_class='wide')]\nbase = table\nmargin_left = -2cm\n# optionally: width = 100%
.. table:: Wide table\n :class: wide\n\n +------------------------+------------+----------+----------+\n | Header row, column 1 | Header 2 | Header 3 | Header 4 |\n | (header rows optional) | | | |\n +========================+============+==========+==========+\n | body row 1, column 1 | column 2 | column 3 | column 4 |\n +------------------------+------------+----------+----------+\n | body row 2 | Cells may span columns. |\n +------------------------+------------+---------------------+\n | body row 3 | Cells may | - Table cells |\n +------------------------+ span rows. | - contain |\n | body row 4 | | - body elements. |\n +------------------------+------------+----------+----------+\n | body row 5 | Cells may also be | |\n | | empty: ``-->`` | |\n +------------------------+-----------------------+----------+
Of course, this isn't yet documented properly. In the meantime, you can have a look at the table* examples in https://github.com/brechtm/rinohtype/tree/master/tests_regression/rst.
","upvoteCount":2,"url":"https://github.com/brechtm/rinohtype/discussions/402#discussioncomment-5177166"}}}-
Beta Was this translation helpful? Give feedback.
-
I can see merit in supporting this, but I'm not convinced rinohtype should provide extra style properties for such a specific case... You can however achieve this with some more manual intervention by defining a wide table style definition for which you set a left margin of -2cm. This wide table style should match tables for which e.g. the wide class is set. I haven't tested this, but it should be a good start: [wide table : Table(has_class='wide')]
base = table
margin_left = -2cm
# optionally: width = 100% .. table:: Wide table
:class: wide
+------------------------+------------+----------+----------+
| Header row, column 1 | Header 2 | Header 3 | Header 4 |
| (header rows optional) | | | |
+========================+============+==========+==========+
| body row 1, column 1 | column 2 | column 3 | column 4 |
+------------------------+------------+----------+----------+
| body row 2 | Cells may span columns. |
+------------------------+------------+---------------------+
| body row 3 | Cells may | - Table cells |
+------------------------+ span rows. | - contain |
| body row 4 | | - body elements. |
+------------------------+------------+----------+----------+
| body row 5 | Cells may also be | |
| | empty: ``-->`` | |
+------------------------+-----------------------+----------+ Of course, this isn't yet documented properly. In the meantime, you can have a look at the table* examples in https://github.com/brechtm/rinohtype/tree/master/tests_regression/rst. |
Beta Was this translation helpful? Give feedback.
I can see merit in supporting this, but I'm not convinced rinohtype should provide extra style properties for such a specific case...
You can however achieve this with some more manual intervention by defining a wide table style definition for which you set a left margin of -2cm. This wide table style should match tables for which e.g. the wide class is set.
I haven't tested this, but it should be a good start: