private void firstTestTable(RtfSection sect)
throws IOException {
sect.newParagraph().newText("First test: table with one nested table in cell 1,1");
final RtfTable tbl = sect.newTable(new DummyTableColumnsInfo());
// first row, normal
{
RtfTableRow r = tbl.newTableRow();
RtfTableCell c = r.newTableCell(160 * MM_TO_TWIPS);
c.newParagraph().newText("cell 0,0, width 160mm, only cell in this row.");
}
// second row contains nested table
{
RtfTableRow r = tbl.newTableRow();
r.newTableCell(40 * MM_TO_TWIPS).newParagraph().newText
("cell 1,0, width 40mm, to the left of nested table.");
final RtfTableCell c = r.newTableCell(80 * MM_TO_TWIPS);
c.newParagraph().newText("cell 1,1, width 80mm, this text is "
+ "followed by a nested table in the same cell, followed "
+ "by text that says 'AFTER NESTED TABLE'.");
fillNestedTable(c.newTable(new DummyTableColumnsInfo()), 1);
c.newParagraph().newText("AFTER NESTED TABLE");
r.newTableCell(40 * MM_TO_TWIPS).newParagraph().newText
("cell 1,2, width 40mm, to the right of nested table.");
}
// third row, normal
{
RtfTableRow r = tbl.newTableRow();
r.newTableCell(80 * MM_TO_TWIPS).newParagraph().newText
("cell 2,0, width 80mm, this row has two cells.");
r.newTableCell(80 * MM_TO_TWIPS).newParagraph().newText
("cell 2,1, width 80mm, last cell.");
}