// Table test
Division tableT = test.addDivision("table");
tableT.setHead("3) Table Tests");
// Simple table
Table table = tableT.addTable("table1",3,3);
table.setHead("Table: simple");
Row row = table.addRow();
row.addCellContent("1.1");
row.addCellContent("1.2");
row.addCellContent("1.3");
row = table.addRow();
row.addCellContent("2.1");
row.addCellContent("2.2");
row.addCellContent("2.3");
row = table.addRow();
row.addCellContent("3.1");
row.addCellContent("3.2");
row.addCellContent("3.3");
// Header vs data rows
table = tableT.addTable("table1",4,3);
table.setHead("Table: header vs data roles");
row = table.addRow(Row.ROLE_HEADER);
row.addCellContent("This whole");
row.addCellContent("row is a");
row.addCellContent("Header");
row = table.addRow();
row.addCellContent("2.1");
row.addCellContent("2.2");
row.addCellContent("2.3");
row = table.addRow();
row.addCellContent("3.1");
row.addCell(Cell.ROLE_HEADER).addContent("3.2 - single cell header");
row.addCellContent("3.3");
row = table.addRow();
row.addCellContent("4.1");
row.addCellContent("4.2");
row.addCellContent("4.3");
// column and row spans
table = tableT.addTable("table1",6,3);
table.setHead("Table: column & row spans");
row = table.addRow();
row.addCellContent("1.1");
row.addCellContent("1.2");
row.addCellContent("1.3");
row = table.addRow();
row.addCell(null,null,0,3,null).addContent("2.1 - spans three columns");
row = table.addRow();
row.addCellContent("3.1");
row.addCell(null,null,3,0,null).addContent("3.2 - spans three rows");
row.addCellContent("3.3");
row = table.addRow();
row.addCellContent("4.1");
//row.addCellContent("3.2"); // Should be missing
row.addCellContent("4.3");
row = table.addRow();
row.addCellContent("5.1");
//row.addCellContent("5.2"); // Should be missing
row.addCellContent("5.3");
row = table.addRow();
row.addCellContent("6.1");
row.addCellContent("6.2");
row.addCellContent("6.3");
}