I'm creating a table, adding a header row and then multiple data rows. I've managed to work out how to create the table, but I have no idea where to look to find out how to format my table.
3 things I'd like to be able to do are
1. Have a solid thin border for all cells in the table (the same border you see when you create a default table in Word)
2. Centre align the text in the header row
3. Bold text in the header row
Below is the code so far. If someone can point me in the right direction, it would be very much appreciated.
- Code: Select all
Tbl tblCredProg = factory.createTbl();
Tr thead = factory.createTr();
addTc(thead, "Centre");
addTc(thead, "Facility Questionnaire");
addTc(thead, "Benchmarking");
addTc(thead, "Site Visit");
addTc(thead, "Overall Result");
tblCredProg.getEGContentRowContent().add(thead);
protected void addTc(Tr tr, String text) {
Tc tc = factory.createTc();
tc.getEGBlockLevelElts().add( wordMLPackage.getMainDocumentPart().createParagraphOfText(text) );
tr.getEGContentCellContent().add( tc );
}