Work with % widths

<< Click to Display Table of Contents >>

Navigation:  Programming > Change text attributes in code > Numbering > Tables >

Work with % widths

 

WPTools Version 9 also has the ability to use % values for column widths. The procedure WPRichText1.TableMakeCellWidthPC converts all tables in the document to measure the column width in %.

 

If the flag wpAlwaysColWidthPC was set in property EditOptionsEx this procedure is executed after a file was loaded and after each change to the column width using the mouse.

 

The % column widtn is stored as property WPAT_ColWidthPC as %*100.

 

// Set the width in 5, example 10%

 WPRichText1.ActivePar.ASetColumn(WPAT_COLWIDTH_PC, 1000);

// Delete the fixed width since it has priority

 WPRichText1.ActivePar.ADelColumn(WPAT_ColWidth);

// Reformat the text

 WPRichText1.DelayedReformat;