drmacro / wordinator

Generate high-quality DOCX files using a simplified XML format (simple word processing XML).
Apache License 2.0
38 stars 8 forks source link

Access to the "jc" table property for table centring #155

Open gkholman opened 2 months ago

gkholman commented 2 months ago

Per the ECMA specification

17.4.26 jc (Table Alignment Exception)


[Example: Consider the following WordprocessingML fragment for a table in a document:
  <w:tblPr>
    <w:jc w:val="center" />
</w:tblPr>
This table is now centered on the page. end example]````

Is there SWPX vocabulary available for us to specify that a table is centred?
gkholman commented 1 month ago

I am attaching a DOCX file

table-centred-hacked.docx

... where I have hacked the second table to include the above element and it creates the desired result:

image

It looks like what is needed is to describe the appropriate semantic in SWPX, add it to the schema, and have it engaged in the code.

larsga commented 1 month ago

Pull request #156 implements this