Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tables: change default word style #857

Open
Yuri05 opened this issue Jul 7, 2022 · 3 comments
Open

Tables: change default word style #857

Yuri05 opened this issue Jul 7, 2022 · 3 comments

Comments

@Yuri05
Copy link
Member

Yuri05 commented Jul 7, 2022

@sfrechen @AnnikaRPS please attach word document (1 page) which contains a table with dummy data in required format

@Yuri05 Yuri05 self-assigned this Jul 7, 2022
@sfrechen
Copy link
Member

sfrechen commented Jul 7, 2022

Table_Template.docx

@Yuri05 Yuri05 added this to To do in Version 2.1 / 2.2 via automation Jul 28, 2022
@pchelle
Copy link
Collaborator

pchelle commented Dec 12, 2022

I have done some testing of the word conversion for the table format.
Currently, the reference word document managing the styles of the report (provided as wordConversionTemplate argument of the workflow) updates the Table properties as follows:

Shading and border styles of the table

  • Select the table cells
  • In Design, click on Modify Table Style...
    • The default style named to be modified should be named Table

    More details available on that Pandoc issue

Font style of the Table

The font defined by the previous workflow was not used by Pandoc in my tests,
however, the following workflow was working to change the font of the table

  • Select the table cells
  • In the font styles, the style named Compact is selected
    • Modify style named Compact

Alignment

Alignment did not work in my tests:

  • The markdown file currently defines a left alignment by default (tables are exported using the function kable from the {knitr} package which outputs |:----| left-aligning the tables)
  • Changing that line in the markdown document did not work as expected
    • |:----| was left aligned
    • |----:| was right aligned
    • |:---:| was still left aligned even when the reference doc Table style used centered cells by default
    • |----| was still left aligned even when the reference doc Table style used centered cells by default

@pchelle
Copy link
Collaborator

pchelle commented Jun 14, 2023

@Yuri05
While creating an article for documenting how to work with word reports
I may have found a solution for alignment.

It is possible to defined inline openxml raw code for alignment

|header 1|long header 2|very long header 3|
|----|-----|-----|
|a     |b     |`<w:pPr><w:jc w:val="right"/></w:pPr>`{=openxml} c|

would render the following in word.

header 1 long header 2 very long header 3
a b c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants