Table table = new Table(3);
// Create a simple RtfCell with a dotted border.
RtfCell cellDotted = new RtfCell("Dotted border");
cellDotted.setBorders(new RtfBorderGroup(LwgRectangle.BOX,
RtfBorder.BORDER_DOTTED, 1, new Color(0, 0, 0)));
// Create a simple RtfCell with an embossed border.
RtfCell cellEmbossed = new RtfCell("Embossed border");
cellEmbossed.setBorders(new RtfBorderGroup(LwgRectangle.BOX,
RtfBorder.BORDER_EMBOSS, 1, new Color(0, 0, 0)));
// Create a simple RtfCell with no border.
RtfCell cellNoBorder = new RtfCell("No border");
cellNoBorder.setBorders(new RtfBorderGroup());
cellNoBorder.setRowspan(2);
// Create a simple RtfCell that only has a border
// on the bottom side.
RtfCell bottomBorder = new RtfCell("Bottom border");
bottomBorder.setBorders(new RtfBorderGroup(LwgRectangle.BOTTOM,
RtfBorder.BORDER_SINGLE, 2, new Color(255, 0, 0)));
// Create a simple RtfCell that has different borders
// on the left and bottom sides.
RtfCell mixedBorder = new RtfCell("Mixed border");
RtfBorderGroup mixedBorders = new RtfBorderGroup();
mixedBorders.addBorder(LwgRectangle.RIGHT,
RtfBorder.BORDER_DOUBLE_WAVY, 2, Color.GREEN);
mixedBorders.addBorder(LwgRectangle.BOTTOM,
RtfBorder.BORDER_DOT_DASH, 1, Color.BLUE);
mixedBorder.setBorders(mixedBorders);
// Add the cells to the table
table.addCell(cellDotted);