Hi John,
Noah Malmed <nma...@scholasticahq.com> writes:
> Hello!
>
> We use Pandoc often to convert from docx to HTML, and many of the
> documents we convert include tables. As far as we can tell, almost all of
> the table styling is lost in the docx reader. Specifically, we care about 5
> things:
>
> 1. Text justification (left, center, or right)
>
> 2. Vertical alignment (top, middle, or bottom)
>
> 3. Text indentation
>
> 4. Cell shading and text color
>
> 5. Table borders
>
> We hope to enhance the docx reader so that these stylings get preserved in
> the AST.
>
> Proposed solutions:
>
> 1. It seems like text justification already exists in the AST through the
> Alignment value. It just needs to get implemented in the docx reader, as
> described in this issue: https://github.com/jgm/pandoc/issues/6316
Correct.
> 2. Add the vertical alignment style to attributes as suggested here
> <https://github.com/jgm/pandoc/issues/7444#issuecomment-881649125>
Should be okay. However, adding `vertical-align` there won't do
any good for converting to HTML unless the HTML writer is
modified to be sensitive to this attribute.
> 3. Add text indentation to attributes in the form of the style padding-left
You're talking about directly adding 'style' to attributes, with
CSS contents? That would make the docx reader very good for
converting to HTML and not so good for any other format.
Note that in general pandoc does not strive to preserve every
small detail of formatting, only structure. See the beginning
of the manual.
> 4. Add cell shading and text color to attributes in the form of the styles
> background-color and color
See above, also search the issue tracker for 'color'.
> 5. Add table borders to attributes in the form of the style border
I think this falls into the category of things that are beyond
pandoc's scope. We don't strive to reproduce all the formatting
details in conversions. Again, see the beginning of the manual.