widthPercent

Type: Real

Availability: Read or write at any time

The widthPercent property of the JadeTableColumn class contains the width of a column to a percentage of the client width of the table, as shown in the following example.

table.accessColumn(2).widthPercent := 20;

The default value of zero (0.0) indicates that the property does not apply, and the width of a column is then the default (set by the Table::columnWidth or JadeTableColumn::width property) or automatically calculated, by using the Table class autoSize property.

If a column has a positive widthPercent value, the width of the column is set to that percentage of the client width of the table. If the table width changes, this value is recalculated accordingly.

If all of the visible columns of a table have a non-zero widthPercent value and those values add up to 100 percent, the table is guaranteed not to have a horizontal scroll bar and the columns exactly fill the width of the table. It is not necessary for the values to add up to 100 percent or for all columns to have a value set.

To use mixed column width values in a table (that is, fixed‑width and percent‑width values), use the widthPercentStyle property of the JadeTableSheet class.

You can use this property in conjunction with the Table class wordWrap and autoSize properties. If word wrap applies to the cells of a column, setting the Table class autoSize property to AutoSize_Row, AutoSize_Both, or AutoSize_BothColumnMinimum determines the row height by using the column width for the word-wrapped text.

Setting the Table class columnWidth property for a column resets the value of the widthPercent property to zero for that column.

If the user resizes a column manually, the value of the widthPercent property for that column is set to zero.

Setting the value of the widthPercent property to any value, including zero, clears any manual resizing of the column and causes the automatic width processes to apply again for that column.