Word tables with different layouts converted to same layout #9395
Replies: 4 comments
-
Could you upload a sample docx that we can take apart to see how tables with different "layouts" are represented? |
Beta Was this translation helpful? Give feedback.
-
Here's an example Word document in which also the CSS code is pasted. |
Beta Was this translation helpful? Give feedback.
-
The borderless table is <w:tbl>
<w:tblPr>
<w:tblStyle w:val="TableGrid"/>
<w:tblW w:w="0" w:type="auto"/>
<w:tblBorders>
<w:top w:val="none" w:sz="0" w:space="0" w:color="auto"/>
<w:left w:val="none" w:sz="0" w:space="0" w:color="auto"/>
<w:bottom w:val="none" w:sz="0" w:space="0" w:color="auto"/>
<w:right w:val="none" w:sz="0" w:space="0" w:color="auto"/>
<w:insideH w:val="none" w:sz="0" w:space="0" w:color="auto"/>
<w:insideV w:val="none" w:sz="0" w:space="0" w:color="auto"/>
</w:tblBorders>
<w:tblLook w:val="04A0" w:firstRow="1" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:noHBand="0" w:noVBand="1"/>
</w:tblPr>
<w:tblGrid>
... The conventional one is <w:tbl>
<w:tblPr>
<w:tblStyle w:val="TableGrid"/>
<w:tblW w:w="10368" w:type="dxa"/>
<w:jc w:val="center"/>
<w:tblLook w:val="04A0" w:firstRow="1" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:noHBand="0" w:noVBand="1"/>
</w:tblPr>
<w:tblGrid>
<w:gridCol w:w="3892"/>
<w:gridCol w:w="1533"/>
<w:gridCol w:w="1156"/>
<w:gridCol w:w="3787"/>
</w:tblGrid>
... Note: pandoc just ignores information about table borders, because it has no way to represent these in its internal document model. (We focus on structure, not presentation, as noted at the beginning of the manual.) So there is really no way for pandoc to treat these tables differently. |
Beta Was this translation helpful? Give feedback.
-
An alternative would be not to use borderless tables for equations. However, there are two problems with this approach (see attached example):
|
Beta Was this translation helpful? Give feedback.
-
I'm using docx reader and html writer but I'm struggling to get the tables formatted correctly. Formatting equations in both Word and html require borderless tables with three cells, the centre of which contains the equation and the right-most the equation number. This renders well in html writer and the appropriate css file but then it's not possible to format conventional tables in html except by using custom styles for the table header and cells and defining these styles in the css file. For simple layouts with few borders this works reasonably well, although there is a gap between the columns (see attached html writer output). It would be nice if docx reader could honour different table layouts and translate them to different table classes that can be defined in the css file.
Beta Was this translation helpful? Give feedback.
All reactions