@@ -746,12 +746,36 @@ export interface IShading {
746
746
backgroundColor : IColorStyle ; // backgroundColor
747
747
}
748
748
749
- /**
750
- * Type of width
751
- */
752
- export enum WidthType {
753
- EVENLY_DISTRIBUTED = '0' ,
754
- FIXED_WIDTH = '1' ,
749
+ export interface IDistFromText {
750
+ distT : INumberUnit ; // distance between top text and table.
751
+ distB : INumberUnit ; // distance between bottom text and table.
752
+ distL : INumberUnit ; // distance between left text and table.
753
+ distR : INumberUnit ; // distance between right text and table.
754
+ }
755
+
756
+ export interface IDocTablePosition {
757
+ positionH : IObjectPositionH ;
758
+ positionV : IObjectPositionV ;
759
+ }
760
+
761
+ enum TableSizeType {
762
+ UNSPECIFIED ,
763
+ SPECIFIED ,
764
+ }
765
+ export interface IWidthInTableSize {
766
+ type : TableSizeType ;
767
+ width : INumberUnit ;
768
+ }
769
+
770
+ enum TableHAlign {
771
+ LEFT ,
772
+ CENTER ,
773
+ RIGHT ,
774
+ }
775
+
776
+ enum TableTextWrapType {
777
+ NONE ,
778
+ WRAP ,
755
779
}
756
780
757
781
/**
@@ -763,8 +787,28 @@ export interface ITable {
763
787
rows : number ; // rows
764
788
columns : number ; // columns
765
789
tableRows : ITableRow [ ] ; // tableRows
766
- tableStyle : WidthType ; // tableStyle
767
- width : number ; // width
790
+ tableColumns : ITableColumn [ ] ; // tableColumns
791
+ align : TableHAlign ; // align
792
+ leftIndent : INumberUnit ; // leftIndent
793
+ textWrap : TableTextWrapType ;
794
+ position : IDocTablePosition ; // position
795
+ dist : IDistFromText ; // dist
796
+ size : IWidthInTableSize ;
797
+ }
798
+
799
+ enum TableCellHeightRule {
800
+ MIN ,
801
+ FIX ,
802
+ }
803
+
804
+ export interface ITableColumn {
805
+ size : IWidthInTableSize ;
806
+ }
807
+
808
+ export interface ITableRowSize {
809
+ type : TableSizeType ;
810
+ height : INumberUnit ;
811
+ heightRule : TableCellHeightRule ;
768
812
}
769
813
770
814
/**
@@ -774,22 +818,18 @@ export interface ITableRow {
774
818
st : number ; // startIndex
775
819
ed : number ; // endIndex
776
820
tableCells : ITableCell [ ] ; // tableCells
777
- tableRowStyle : ITableRowStyle ; // tableRowStyle
778
- }
779
-
780
- /**
781
- * Properties of style table row
782
- */
783
- export interface ITableRowStyle {
784
- minRowHeight : number ; // minRowHeight
821
+ size : ITableRowSize ; // tableRowStyle
822
+ allowBreakAcrossPages : BooleanNumber ; // allowBreakAcrossPages, the default is false.
823
+ isFirstRow : BooleanNumber ; // isFirstRow.
824
+ repeatHeaderRow : BooleanNumber ; // Show header row in different pages. only for the first row.
785
825
}
786
826
787
827
/**
788
828
* Properties of table cell
789
829
*/
790
830
export interface ITableCell {
791
- // st: number; // startIndex
792
- // ed: number; // endIndex
831
+ st : number ; // startIndex
832
+ ed : number ; // endIndex
793
833
// content: IBlockElement[]; // content
794
834
tableCellStyle : ITableCellStyle ; // tableCellStyle
795
835
}
@@ -805,32 +845,40 @@ export interface ITableCellStyle {
805
845
borderRight : ITableCellBorder ; // borderRight
806
846
borderTop : ITableCellBorder ; // borderTop
807
847
borderBottom : ITableCellBorder ; // borderBottom
808
- paddingLeft : number ; // paddingLeft
809
- paddingRight : number ; // paddingRight
810
- paddingTop : number ; // paddingTop
811
- paddingBottom : number ; // paddingBottom
812
- contentAlignment : ContentAlignment ; // contentAlignment
848
+ paddingLeft : INumberUnit ; // paddingLeft
849
+ paddingRight : INumberUnit ; // paddingRight
850
+ paddingTop : INumberUnit ; // paddingTop
851
+ paddingBottom : INumberUnit ; // paddingBottom
852
+ size : IWidthInTableSize ; // size
853
+ contentHAlignment : ContentHAlignment ; // contentAlignment
854
+ contentVAlignment : ContentVAlignment ; // contentAlignment
813
855
}
814
856
815
857
/**
816
858
* Properties of cell border
817
859
*/
818
860
export interface ITableCellBorder {
819
861
color : IColorStyle ; // color
820
- width : number ; // width
862
+ width : INumberUnit ; // width
821
863
dashStyle : DashStyleType ; // dashStyle
822
864
}
823
865
/**
824
866
* The content alignments for a Shape or TableCell. The supported alignments correspond to predefined text anchoring types from the ECMA-376 standard.
825
867
*/
826
- export enum ContentAlignment {
868
+ export enum ContentVAlignment {
827
869
CONTENT_ALIGNMENT_UNSPECIFIED , // An unspecified content alignment. The content alignment is inherited from the parent if one exists.
828
- CONTENT_ALIGNMENT_UNSUPPORTED , // An unsupported content alignment.
829
870
TOP , // An alignment that aligns the content to the top of the content holder. Corresponds to ECMA-376 ST_TextAnchoringType 't'.
830
871
MIDDLE , // An alignment that aligns the content to the middle of the content holder. Corresponds to ECMA-376 ST_TextAnchoringType 'ctr'.
831
872
BOTTOM , // An alignment that aligns the content to the bottom of the content holder. Corresponds to ECMA-376 ST_TextAnchoringType 'b'.
832
873
}
833
874
875
+ export enum ContentHAlignment {
876
+ CONTENT_ALIGNMENT_UNSPECIFIED , // An unspecified content alignment. The content alignment is inherited from the parent if one exists.
877
+ LEFT , // An alignment that aligns the content to the left of the content holder.
878
+ CENTER , // An alignment that aligns the content to the center of the content holder.
879
+ RIGHT , // An alignment that aligns the content to the right of the content holder.
880
+ }
881
+
834
882
/**
835
883
* Types of font style
836
884
*/
@@ -889,6 +937,7 @@ export enum NumberUnitType {
889
937
LINE ,
890
938
CHARACTER ,
891
939
PIXEL ,
940
+ PERCENT ,
892
941
}
893
942
894
943
// 20.4.3.1 ST_AlignH (Relative Horizontal Alignment Positions)
0 commit comments