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 2:00 pm

Hello,
I have a table like this:

Dim tblT As Table = SecT.AddTable(True)

Dim HeadTurni() As String = {"A", "B", ....}

Dim dataT()() As String = { _
New String() {"a", "b ", ...}, _
New String() {"v", "w ", ...}}
....

I want to see a Horizontal line ONLY after the reader row, and a Vertical line after every column, so:

tblT.TableFormat.Borders.Vertical.BorderType = Spire.Doc.Documents.BorderStyle.Thick
tblT.TableFormat.Borders.Horizontal.BorderType = Spire.Doc.Documents.BorderStyle.None

tblT.Rows(0).RowFormat.Borders.Horizontal.BorderType = Spire.Doc.Documents.BorderStyle.Thick
tblT.Rows(0).RowFormat.Borders.Horizontal.Color = Drawing.Color.Black

Ok for the vertical lines, but this way I can't see the horizontal line after the header row.
Why?

All around the cells there is a white border which "eats" part of the inside text. I don't want to reduce the cells width, but I want to see the text completely, so I want to remove the inside border of the cells. How can I do?

thank you...!
Paola

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

Tue Apr 28, 2015 10:21 am

Dear Paola,

Thanks for your inquiry.
Please use the following code to set the borders.
Code: Select all
  For Each cell As TableCell In tblT.Rows(0).Cells
   cell.CellFormat.Borders.Bottom.BorderType = Spire.Doc.Documents.BorderStyle.Thick
Next

For the second issue, please use the below line to let cell auto fit its content .
Code: Select all
  tblT.TableFormat.IsAutoResized = True


Best wishes,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Wed Apr 29, 2015 9:33 am

Hello,
your solution for the first issue works perfectly, thank you.
For the second, I'm sorry but I still see the text erased, so I reduced the font.
thank you anyway,
best wishes
Paola

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

Thu Apr 30, 2015 3:12 am

Hello,

Thanks for your response.
Please feel free to contact us if you need any question or needs.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Tue May 05, 2015 7:46 am

Hello,
I reduced the text but so it is unreadable.
So I would find the way to remove the space between the text and the borders (horizontal borders) of the cells.
I add the text this way:
parRow = rowT.Cells(c).AddParagraph()
parRow.AppendText("mytext...").ApplyCharacterFormat(fCourier8)
parRow.Format.HorizontalAlignment = HorizontalAlign.Left
parRow.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalOrigin.Margin

Then, I found these statements to try to remove the space between the text and the horizontal borders:
parRowiga.Format.Borders.Space = 0
or also:
tblT.Rows(r).Cells(c).CellFormat.Borders.Space = 0

the help says:
"sets width of space to mantain between borders and text within borders"
which seems to be what I'm looking for,
but it doesn't work,
How can I do?..
Thank you,
Paola

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

Tue May 05, 2015 8:48 am

Dear Paola,

Please share all your code and the version you used because we still don't reproduce your text unreadable issue.
You also send your project to amy.zhao@e-iceblue.com or support@e-iceblue.com via e-mail.

Thank you.

Best wishes,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Tue May 05, 2015 9:15 am

Hello,
"unreadable" I mean that it's too small...:)
My version should be the latest of year 2014.
This is my code:

For r = 0 To 59
Dim rowT As TableRow = tblT.Rows(r + 1)
rowT.Height = 8.6
rowT.RowFormat.CellSpacing = 0
Dim parRow As Paragraph
For c As Integer = 0 To 20
parRow = rowT.Cells(c).AddParagraph()
parRow.AppendText("My text is...").ApplyCharacterFormat(fCourier8)
parRow.Format.HorizontalAlignment = HorizontalAlign.Left
parRow.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalOrigin.Margin
parRow.Format.Borders.Space = 0
tblT.Rows(r).Cells(c).CellFormat.Borders.Space = 0
Next c
Next r

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

Tue May 05, 2015 9:29 am

Hello,

Please try the following setting.
Code: Select all
parRow.AppendText("My text is...").ApplyCharacterFormat(fCourier8)
parRow.Format.HorizontalAlignment = HorizontalAlignment.Left
tblT.Rows(r).Cells(c).CellFormat.SamePaddingsAsTable = False
tblT.Rows(r).Cells(c).CellFormat.Paddings.All = 0


Best wishes,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Tue May 05, 2015 9:51 am

Great!!!
It works fine!!
thank you very much.


But...if I want lo leave just a thin space between the borders and the text....
tblTurni.Rows(r).Cells(c).CellFormat.Paddings.All = 1 is not ok....

best regards,
Paola

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

Wed May 06, 2015 6:11 am

Hello,

I have failed to reproduce your issue with the Spire.Doc( Version:5.4),please download it from the following link and have a try:
http://www.e-iceblue.com/Download/downl ... t-now.html
If there are any questions, welcome to get it back to us.

Best Regards,
Betsy
E-iceblue support team
User avatar

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

Thu May 07, 2015 7:19 am

Hello,

Has your issue been resolved? Could you please give us some feedback at your convenience?

Thanks,
Betsy
E-iceblue support team
User avatar

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

Return to Spire.Doc