We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Java slides � Can�t change table cell default (blue) background color

Hello Team,

I am trying to change cell background color. Below URL was shared on chat by Aspose chat representative but the code on this link only changes the text color and doesn’t change cell background color. Please find attached image for better understanding of this issue.

http://www.aspose.com/docs/display/slidesjava/Vertically+align+the+text+in+table+cell

Please advise!

Regards,

Pavan

Hi Pavan,


I have observed your comments and like to request you to please try using following sample code on your end to serve the purpose.

Presentation pres = new Presentation();

//Get the first slide
ISlide slide = pres.getSlides().get_Item(0);

//Define columns with widths and rows with heights
double[] dblCols = { 120, 120, 120, 120 };
double[] dblRows = { 100, 100, 100, 100 };
//Add table shape to slide
ITable table = slide.getShapes().addTable(100, 50, dblCols, dblRows);
ICell cell = table.getRows().get_Item(0).get_Item(0);
cell.getFillFormat().setFillType(FillType.Solid);
cell.getFillFormat().getSolidFillColor().setColor(Color.yellow);

pres.save(“D:\test.pptx”, SaveFormat.Pptx);

Please let us know if the issue persists. We will be happy to assist you further.

Best Regards,

Hi Pavan,


I have observed your requirement and suggest you to please try using the following sample code on your end to change the cell background color. I hope this will be helpful. Please share, if I may help you further in this regard.

ICell cell = table.get_Item(0, 0);
cell.getFillFormat().setFillType(FillType.Solid);
cell.getFillFormat().getSolidFillColor().setColor(Color.RED);

Many Thanks,