Skype:TextControlSupport
Orders:877-462-4772
TX Text Control - word processing components.
« »

Adjusting table columns using inches

Blogged by Gunnar Giffey on April 05, 2005 and tagged with Samples, .NET.

Recently, I have received several questions concerning metrics for tables and how to adjust rows and columns to a given value.

As height and width are measured in twips, it is necessary to convert the value from inches or centimeters in to twips. The conversion is as follows:

1 inch = 1440 twips
1 cm = 567 twips

Knowing this unit of conversion, it is easy to adjust the width to 0.5 inches, for example. The following Visual Basic source code illustrates how to achieve this:

Private Sub columnWidthAdjust()
Dim i As Integer
For i = TXTextControl1.TableColumns(
TXTextControl1.TableAtInputPos) To 1 Step -1
TXTextControl1.TableCellAttribute(TXTextControl1.
TableAtInputPos, 0, i, txTableCellHorizontalExt) = 720
Next i
End Sub

Please note that each column is adjusted separately. Therefore, it is possible to add an array that contains different widths that can in turn be assigned to columns.

« Prev:Append files to the current document
» Next:Embedding images in various formats

Comments

If you would like to comment on this blog entry, please post a comment.

External verification page for ISO 9000:2000 certificate
ISO 9001:2000
certified