We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Table Cell Borders

Thread ID:

Created:

Updated:

Platform:

Replies:

120619 Sep 28,2015 09:36 AM UTC Sep 29,2015 02:10 PM UTC ASP.NET MVC 1
loading
Tags: DocIO
Andrea Perazzolo
Asked On September 28, 2015 09:36 AM UTC

Hi,
I am adding a Table in the document  that has the Default Borders (1 pt Solid).
On some rows I have 2 cells  and need to remove the internal borders of those cells.
I tried with this code:

= tbl.AddRow(false);
 r.HeightType = TableRowHeightType.AtLeast;
 r.Height = 20f;
 r.RowFormat.Borders.Bottom.BorderType = BorderStyle.None;
 r.RowFormat.Borders.Bottom.LineWidth = 0f;
 r.Cells.Clear();
 r.AddCell(false);
 r.AddCell(false);
 r.Cells[0].Width = 200f;
 r.Cells[1].Width = w - 200f;
 r.Cells[0].CellFormat.Borders.Right.BorderType = BorderStyle.None;
 r.Cells[0].CellFormat.Borders.Right.LineWidth = 0f;
 r.Cells[0].CellFormat.Borders.Bottom.BorderType = BorderStyle.None;
 r.Cells[0].CellFormat.Borders.Bottom.LineWidth = 0f;
 r.Cells[0].CellFormat.Borders.Top.BorderType = BorderStyle.None;
 r.Cells[0].CellFormat.Borders.Top.LineWidth = 0f;
 r.Cells[1].CellFormat.Borders.Left.BorderType = BorderStyle.None;
 r.Cells[1].CellFormat.Borders.Left.LineWidth = 0f;
 r.Cells[1].CellFormat.Borders.Bottom.BorderType = BorderStyle.None;
 r.Cells[1].CellFormat.Borders.Bottom.LineWidth = 0f;
 r.Cells[1].CellFormat.Borders.Top.BorderType = BorderStyle.None;
 r.Cells[1].CellFormat.Borders.Top.LineWidth = 0f;
I repeated this for some rows but the borders are present on those cells.
The same operation works with the property pages inside Word.
Have I done something wrong?
There is a workaround for this (I have not tried the conversion to pdf that will be the final format of the document generated).

    Thanks in advance

    Andrea Perazzolo
  





Sathish K [Syncfusion]
Replied On September 29, 2015 02:10 PM UTC

Hi Andrea,

Thank you for contacting Syncfusion support.

Kindly defined the border style as “Cleared” instead of “None” which will clear the internal borders as expected. It will be working fine even in Word document to Pdf conversion also.

Code Example:
r.Cells[0].CellFormat.Borders.Left.BorderType = BorderStyle.Cleared;

r.Cells[0].CellFormat.Borders.Right.BorderType = BorderStyle.Cleared;

r.Cells[0].CellFormat.Borders.Top.BorderType = BorderStyle.Cleared;
r.Cells[0].CellFormat.Borders.Bottom.BorderType = BorderStyle.Cleared;

Regards,
Sathish


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;