* @throws OpenXML4JException
*/
private TableDescription buildTestData() throws OpenXML4JException {
// build the table info
int nbCol = 3;
TableDescription tableDesc = new TableDescription(
ParagraphAlignment.LEFT);
// do not use the standar border, make our own, color red, with -.-
TableBorder border = new TableBorder(BorderStyle.BORDER_STYLE_DOT_DASH,
8, "FF0000");
tableDesc.setBorder(border);
// build cells and lines
for (int lineNo = 0; lineNo < 5; lineNo++) {
ArrayList<String> line = new ArrayList<String>();
for (int col = 0; col < nbCol; col++) {
line.add(new String("line=" + lineNo + " col=" + col));
}
// (a table line can be as simple as a list of string)
tableDesc.appendLine(line);
}
// make a special configuration for a cell
// set the size of the cell (not automatically computed by MS-Word
tableDesc.getCellAt(1, 2)
.setCellSize(
new TableCellSize(TableWidthType.TABLE_WIDTH_DXA,
(short) 4096));
tableDesc.getCellAt(1, 2).setCellBackgroundColor("FA0000"); // set a red
// background
return tableDesc;
}