Hi,
Personally, I prefer to use an extension for this case.
I believe the following code help you. You can use this code with appending
them to your conf.py.
```
from docutils import nodes
from sphinx.transforms import SphinxTransform
class AdjustTableAlign(SphinxTransform):
default_priority = 500
def apply(self):
if self.app.builder.name != 'latex':
return
for node in self.document.traverse(nodes.table):
node.attributes.setdefault('align', 'left')
def setup(app):
app.add_post_transform(AdjustTableAlign)
```
I know the python code is a bit harder to understand and to maintain it.
But this does not touch the LaTeX macros directly, so this way is a
bit robuster than
writing LaTeX macros.
Thanks,
Takeshi KOMIYA
2018-01-11 4:59 GMT+09:00 'Erin Kelly' via sphinx-users
<[email protected]>:
> Apparently in 1.6.1 the default table alignment changed from left to center.
> I want all my tables to align left.
>
> The change documentation says I can use Docutils :align: option but that
> only works if I'm using a .. table:: tag
> I'm using this style of tables:
> +------------+------------+-----------+
> | Header 1 | Header 2 | Header 3 |
> +============+============+===========+
> | body row 1 | column 2 | column 3 |
> +------------+------------+-----------+
>
> I tried throwing the table tag above this kind of table but it didn't
> understand that.
>
> Is there something I can put in the latex preamble to reset the default to
> align left?
>
> --
> You received this message because you are subscribed to the Google Groups
> "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sphinx-users.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.