Skip to content

Improve table styling by imitating Word's table styles #12

@Athari

Description

@Athari

Customizing borders of tables is a mess. Removing table outer borders requires customizing every cell.

Look into supporting table styles like in Microsoft Word, at least for borders, but possibly for colors and alignment.

Example Word style:

<w:style w:type="table" w:styleId="InfoTable">
  <w:pPr>
    <w:spacing w:after="0pt" w:line="12pt" w:lineRule="auto"/>
  </w:pPr>
  <w:rPr>
    <w:rFonts w:ascii="Arial Narrow" w:hAnsi="Arial Narrow"/>
    <w:sz w:val="19"/>
  </w:rPr>
  <w:tblPr>
    <w:tblBorders>
      <w:top w:val="single" w:sz="4" w:space="0" w:color="auto"/>
      <w:start w:val="single" w:sz="4" w:space="0" w:color="auto"/>
      <w:bottom w:val="single" w:sz="4" w:space="0" w:color="auto"/>
      <w:end w:val="single" w:sz="4" w:space="0" w:color="auto"/>
      <w:insideH w:val="single" w:sz="4" w:space="0" w:color="auto"/>
    </w:tblBorders>
  </w:tblPr>
  <w:tcPr>
    <w:vAlign w:val="center"/>
  </w:tcPr>
  <w:tblStylePr w:type="firstCol">
    <w:pPr>
      <w:jc w:val="start"/>
    </w:pPr>
    <w:rPr>
      <w:b/>
    </w:rPr>
    <w:tblPr/>
    <w:tcPr>
      <w:tcBorders>
        <w:top w:val="nil"/>
        <w:start w:val="nil"/>
        <w:bottom w:val="nil"/>
        <w:end w:val="single" w:sz="4" w:space="0" w:color="auto"/>
        <w:insideH w:val="nil"/>
        <w:insideV w:val="nil"/>
        <w:tl2br w:val="nil"/>
        <w:tr2bl w:val="nil"/>
      </w:tcBorders>
      <w:vAlign w:val="top"/>
    </w:tcPr>
  </w:tblStylePr>
</w:style>

Example Word style usage:

<w:tblPr>
  <w:tblStyle w:val="InfoTable"/>
  <w:tblLook w:firstRow="0" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:noHBand="1" w:noVBand="1"/>
</w:tblPr>

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions