2
votes

I can add a border to a table row, but how can I add a top border to a table cell? I cannot seem to find this in the ECMA documentation.

   TableProperties tblProperties = new TableProperties();
    TableBorders tblBorders = new TableBorders();
    TopBorder topBorder = new TopBorder();
    topBorder.Val = new EnumValue<BorderValues>(BorderValues.Thick);
    topBorder.Color = "CC0000";
    tblBorders.AppendChild(topBorder);

    tblProperties.AppendChild(tblBorders);
1
Could it be helpfull maybe OpenXML SDK having borders for cellBelurd
My standard comment. Download the OpenXML Productivity Tool from the Microsoft site. Create a Word doc (in Word) that has a table. Save it. Change the table so that a table cell has a top border. Save that file with a different name. Open the productivity tool and use the Compare/Diff button to diff the two files. The answer should be obvious.Flydog57

1 Answers

0
votes

Flydog57's comment to using the OpenXML Productivity Tool is the correct approach. You will spend way too much time attempting to figure things out on your own. Make a word document and then view it using the OpenXML Productivity Tool. Rinse and repeat.