Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Apr 27, 2015 9:09 am

Hello,
I can't set the columns width in a table.

I created an array like this:
Dim WCellT(6) As Int32
WCellT(0) = 5
WCellT(1) = 2
WCellT(2) = 3
WCellT(3) = 20
WCellT(4) = 5
WCellT(5) = 6

My table has 6 columns.

for r As Integer = 0 To 5
For c As Integer = 0 To datiTurni(r).Length - 1

pRow = rowT.Cells(c).AddParagraph()
Dim TR2 As TextRange = pRow.AppendText(dataT(r)(c))

tblTT.Rows(r).Cells(c).Width = CellWidthType.Percentage.ToString = WCellT(c).ToString or also:
tblTT.Rows(r).Cells(c).Width = CellWidthType.Point.ToString = WCellT(c).ToString or also:
tblTT.Rows(r).Cells(c).Width = WCellT(c).ToString
next c
next r


None of these three solutions work,
Can anyone help me?
thank you,
Paola

paolagumi
 
Posts: 81
Joined: Tue Apr 21, 2015 11:32 am

Mon Apr 27, 2015 10:01 am

Hello,

Thanks for your inquiry.
You can refer the following code:
table.Rows[0].Cells[0].SetCellWidth(30, CellWidthType.Percentage);

Sincerely,
Betsy
E-iceblue support team
Last edited by Betsy on Mon Apr 27, 2015 12:45 pm, edited 1 time in total.
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Mon Apr 27, 2015 10:08 am

ok, it works,
thank you,
Paola

paolagumi
 
Posts: 81
Joined: Tue Apr 21, 2015 11:32 am

Return to Spire.Doc