I am facing some problems in reading the documentation. I am not finding what I exactly needed. These are simple things and hard to find.
I want to remove border for a particular cell and align text to center.
Thanks for your interest in Aspose.Slides.
First of all please mention that whether you want to add the table in PPT or in PPTX. In PPT you can set the border on table level using the code snippet lined mentioned below. However, you can align the text of any particular cell to left, right, or center, individually because it is set on portion level. Please use the code snippet given below for text alignment issues.
int iWidth = 0;
Setting iWidth to '0' will hide the borders. Please use the following method for setting text style.
private static void setFontLook(int i, int j,Aspose.Slides.Table table)
table.GetCell(i, j).TextFrame.Paragraphs.Portions.FontIndex = 1;
table.GetCell(i, j).TextFrame.Paragraphs.Alignment = TextAlignment.Center;
table.GetCell(i, j).TextFrame.Paragraphs.Portions.FontBold = true;
table.GetCell(i, j).TextFrame.Paragraphs.Portions.FontColor = Color.Black;
table.GetCell(i, j).TextFrame.Paragraphs.Portions.FontHeight = 18;
Thanks and Regards,
I want the border to be removed only for the cell in a table.
And I have solved the problem with below code.
Aspose.Slides.Cell cell1 = table.GetCell(0, 3);
private void RemoveBorder(CellBorder border)
IEnumerator iter = border.GetEnumerator();
// Loop through all the lines
Aspose.Slides.Line line = (Aspose.Slides.Line)iter.Current;
line.LineFormat.ForeColor = Color.White;
// Setting the width of the top border
line.LineFormat.Width = 0;
This solved the problem and hope this helps someone else.
I am really thankful to you for correcting me. We always admire the positive feedback and active participation from our customers. We shall make it part of documentation for our future reference.
Thanks and Regards,
I have read the documentation and found it. It’s common that anyone don’t about everything. So, sometimes this happens… Solving the problem is important, no matter what who solved the problem. Helping each other is what make successful in anything.