I can add a class name (nospacing) to a table tag but not sure how this would automatically apply a paragraph style to paragraphs within the table since the paragraphs are automatically added by the HtmlToOpenXml library?
<table class="nospacing"> <tr> <td> <p class="?????"></p> </td> </tr> </table> I know how to add a paragraph style to the document and I can understand finding all paragraphs within a table using something like this ...
foreach (var table in mainPart.RootElement.Descendants<Table>())
{
foreach (var para in table.Descendants<Paragraph>())
{
}
and then manually applying the style to each paragraph.
But imagine there is a much nicer way to do it.
<table class="nospacing"> <tr> <td> <p class="?????"></p> </td> </tr> </table> I know how to add a paragraph style to the document and I can understand finding all paragraphs within a table using something like this ...
foreach (var table in mainPart.RootElement.Descendants<Table>())
{
foreach (var para in table.Descendants<Paragraph>())
{
// apply paragraph style ....
} }
and then manually applying the style to each paragraph.
But imagine there is a much nicer way to do it.