Find some cells in table

Hi there,I have question and need your help.

I export the from html contains some tables to word.
But I want to find some cell by a css class to set other properties (like image I attached, I want to find the blue cell by ‘bgr-blue’ css class and set some properties for it but not sure aspose can find it or not, and how can I do that.

<table>
	</span><tr>
		</span><td class='bgr-blue'></td>
		</span><td></td>
		</span><td class='bgr-blue'></td>
	</span></tr>
</table>

I’m using aspose word v15.8

Please help.
Thanks!

Hi Huy,

Thanks for your inquiry. Please try using the following code:

Table tab = doc.FirstSection.Body.Tables[0];
foreach (Row row in tab)
{
    foreach (Cell cell in row)
    {
        if (!cell.CellFormat.Shading.BackgroundPatternColor.Equals(Color.Empty))
        {
            // Code here
        }
    }
}

I hope, this helps.

Best regards,

Hi Awais,
Thanks for you help.

Is there any way to find the css class of or ? Because I really want to find it.

Hi Huy,

Thanks for your inquiry. I am afraid, the Row and Cell classes don’t have a Style property but you can work with different formatting properties of the cell or row using Cell.CellFormat or Row.RowFormat properties to achieve what you are looking for.

Best regards,