Hello support,
Hi Kevin,
Thanks for your interest in Aspose.Slides.
You can set the both text font and background color of table cell. Please use the following code snippet that contains an example of table creation along with setting the background color of cells, border lines and text inside cell. Please share with us, if the problem still persists.
//Instantiate PresentationEx class that represents PPTX file
PresentationEx pres = new PresentationEx();
//Access first slide
SlideEx sld = pres.getSlides().get(0);
//Define columns with widths and rows with heights
double[] dblCols = { 50,50,50 };
double[] dblRows = { 50,30,30,30,30 };
//Add table shape to slide
int idx = sld.getShapes().addTable(100, 50, dblCols, dblRows);
TableEx tbl = (TableEx)sld.getShapes().get(idx);
java.awt.Color Color=new java.awt.Color(255,255,0);
java.awt.Color Color2=new java.awt.Color(0,0,255);
//Set border format for each cellfor( int i=0;i < tbl.getRows().size();i++ )
for( int j=0;j< tbl.getColumns().size();j++ )
{
CellEx cell= tbl.get(j, i);
cell.getFillFormat().setFillType(FillTypeEx.SOLID);
cell.getFillFormat().getSolidFillColor().setColor(Color2 );
cell.getBorderTop().getFillFormat().setFillType(FillTypeEx.SOLID);
cell.getBorderTop().getFillFormat().getSolidFillColor().setColor(Color );
cell.getBorderTop().setWidth(5);
cell.getBorderBottom().getFillFormat().setFillType(FillTypeEx.SOLID);
cell.getBorderBottom().getFillFormat().getSolidFillColor().setColor(Color);
cell.getBorderBottom().setWidth(5);
cell.getBorderRight().getFillFormat().setFillType(FillTypeEx.SOLID);
cell.getBorderRight().getFillFormat().getSolidFillColor().setColor(Color);
cell.getBorderRight().setWidth(5);
cell.getBorderLeft().getFillFormat().setFillType(FillTypeEx.SOLID);
cell.getBorderLeft().getFillFormat().getSolidFillColor().setColor(Color);
cell.getBorderLeft().setWidth(5);
}java.awt.Color fColor=new java.awt.Color(0,255,0);
TextFrameEx tText=tbl.get(0,0).getTextFrame ();
tText.setText ("Hello World");
PortionEx por=tText.getParagraphs().get(0).getPortions().get(0);
//Setting font color
por.getFillFormat().setFillType(FillTypeEx.SOLID);
por.getFillFormat().getSolidFillColor().setColor(fColor);//Write PPTX to Disk
pres.write("d:\\Aspose Data\\JavaData\\tableJ.pptx");
Thanks and Regards,