Class TableHelper

java.lang.Object
org.docx4j.convert.in.xhtml.TableHelper

public class TableHelper extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    insertDummyVMergedCells(org.docx4j.wml.ContentAccessor trContext, com.openhtmltopdf.newtable.TableCellBox tcb, boolean backwards)
    Rowspan and colspan support.
    protected boolean
    isTableStyle(org.docx4j.wml.Style s)
     
    protected void
    nestedTableHierarchyFix(org.docx4j.wml.ContentAccessor contentContext, com.openhtmltopdf.render.Box parent)
    nested tables XHTML renderer seems to construct a tree: table/table instead of table/tr/td/table? TODO fix this upstream.
    protected void
    setupTblGrid(com.openhtmltopdf.newtable.TableBox cssTable, org.docx4j.wml.Tbl tbl, XHTMLImporterImpl.TableProperties tableProperties)
     
    protected void
    setupTblPr(com.openhtmltopdf.newtable.TableBox cssTable, org.docx4j.wml.Tbl tbl, XHTMLImporterImpl.TableProperties tableProperties)
     
    protected void
    setupTcPr(com.openhtmltopdf.newtable.TableCellBox tcb, org.docx4j.wml.Tc tc, XHTMLImporterImpl.TableProperties tableProperties)
     
    protected void
    setupTrPr(com.openhtmltopdf.newtable.TableRowBox trBox, org.docx4j.wml.Tr tr)
     
    protected int
    tableIndentContrib(LinkedList<org.docx4j.wml.ContentAccessor> contentContextStack)
    Where list item indentation is affected by the presence of tables, we could adjust for this in the numbering, or in an ad hoc property.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • log

      public static org.slf4j.Logger log
  • Constructor Details

  • Method Details

    • setupTblPr

      protected void setupTblPr(com.openhtmltopdf.newtable.TableBox cssTable, org.docx4j.wml.Tbl tbl, XHTMLImporterImpl.TableProperties tableProperties)
      Parameters:
      cssTable -
      tbl -
      tableProperties -
    • setupTblGrid

      protected void setupTblGrid(com.openhtmltopdf.newtable.TableBox cssTable, org.docx4j.wml.Tbl tbl, XHTMLImporterImpl.TableProperties tableProperties)
    • setupTrPr

      protected void setupTrPr(com.openhtmltopdf.newtable.TableRowBox trBox, org.docx4j.wml.Tr tr)
    • setupTcPr

      protected void setupTcPr(com.openhtmltopdf.newtable.TableCellBox tcb, org.docx4j.wml.Tc tc, XHTMLImporterImpl.TableProperties tableProperties)
    • insertDummyVMergedCells

      protected void insertDummyVMergedCells(org.docx4j.wml.ContentAccessor trContext, com.openhtmltopdf.newtable.TableCellBox tcb, boolean backwards)
      Rowspan and colspan support. Search for lower parts of vertically merged cells, adjacent to current cell in given direction. Then insert the appropriate number of dummy cells, with the same horizontal merging as in their top parts into row context.
      Parameters:
      trContext - context of the row to insert dummies into
      tcb - current cell
      backwards - direction flag: if true, then scan to the left
    • nestedTableHierarchyFix

      protected void nestedTableHierarchyFix(org.docx4j.wml.ContentAccessor contentContext, com.openhtmltopdf.render.Box parent)
      nested tables XHTML renderer seems to construct a tree: table/table instead of table/tr/td/table? TODO fix this upstream. TestCase is http://en.wikipedia.org/wiki/Office_Open_XML
      Parameters:
      contentContext -
      parent -
    • isTableStyle

      protected boolean isTableStyle(org.docx4j.wml.Style s)
    • tableIndentContrib

      protected int tableIndentContrib(LinkedList<org.docx4j.wml.ContentAccessor> contentContextStack)
      Where list item indentation is affected by the presence of tables, we could adjust for this in the numbering, or in an ad hoc property. Which is better? Ad hoc property is better, since in a contrived example, not all list items are in the table. See example src/test/resources/numbering/indents_with_tables.html
      Returns: