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

Free Support Forum - aspose.com

Determine Background Color in Table Row / Cell

Hi,
is it possible to determine and set the backgroundcolor of a table row / cell ?
Thanks
Oliver

Hi
Thanks for your request. Yes, of course, you can determine background color of table cell. Please see the following code example:

// Open document
Document doc = new Document(@"Test101\in.doc");
// Get table
Table tab = doc.FirstSection.Body.Tables[0];
// Determine background color of first cell
Color cellbg = tab.FirstRow.FirstCell.CellFormat.Shading.BackgroundPatternColor;
Console.Write(cellbg);

Also, see the following link.
https://reference.aspose.com/words/net/aspose.words.tables/cellformat/shading/
Best regards,