Table Size and Position

[Top]  [Chapter]  [Previous]  [Next]

A table usually uses the complete text area, this is the page width minus the left and right margins.

 

Property to set the width in twips: WPAT_BoxWidth

 

Property to set the width in percent * 100  of the page width

WPAT_BoxWidth_PC

 

Offset from the left margin. Can be negative to be to the lefgt of the text area.

WPAT_BoxMarginLeft

 

Offset from the left margin. If negative the table is extended into the margin area

WPAT_BoxMarginRight

 

Horizontal Alignment of the table: WPAT_Box_Align:

 possible values are WPBOXALIGN_RIGHT and WPBOXALIGN_HCENTERTEXT

 

The column width is defined by the properties WPAT_ColWidth and WPAT_ColWidth_PC. The first is the width in twips, the latter is the width in percent * 10 (Example: 1000 sets a width of 10%).

 

WPAT_ColWidth has priority over WPAT_ColWidth_PC. You will need to delete the WPAT_ColWidth flag if you need to set the width in percent.

 

   CurrPar.ParADel(WPAT_ColWidth)

   CurrPar.ParASet(WPAT_ColWidth_PC, 1000); // 10%

 

You can read the current width of a cell using the method cell.IsWidthTW. The text must be formatted. Once the user resizes columns in a table all widths which are defined by a percent value will be converted into exact WPAT_ColWidth values. You can force this conversion for the complete text using the function WPRichText.TableFixAllCellWidths. This method can also round the width values suing a 'snap value'. The method TableAdjustCellWidth can be used to recalculate the width of all columns to keep them visible.

 

The property WPAT_BoxMinHeight can be used with table rows to set the minimum height of a table row.

WPAT_BoxMaxHeight is used to set the maximum width. Both properties will be ignored in cells which are merged vertically. They can be used together when using WPT format, in RTF only the minimum value can be preserved if both are used.

 

Note: There are some commands available to read and set the current row height using the method ParCommand.

 


[tablesizeandposition.htm]    Copyright © 2007 by WPCubed GmbH