container.setAlignment(cell.getHorizontalAlignment());
container.add(element);
}
} else {
if(container != null) {
RtfBasicElement rtfElement = this.document.getMapper().mapElement(container);
rtfElement.setInTable(true);
this.content.add(rtfElement);
container = null;
}
// if horizontal alignment is undefined overwrite
// with that of enclosing cell
if (element instanceof Paragraph && ((Paragraph) element).getAlignment() == Element.ALIGN_UNDEFINED) {
((Paragraph) element).setAlignment(cell.getHorizontalAlignment());
}
RtfBasicElement rtfElement = this.document.getMapper().mapElement(element);
rtfElement.setInTable(true);
this.content.add(rtfElement);
}
} catch(DocumentException de) {
de.printStackTrace();
}
}
if(container != null) {
try {
RtfBasicElement rtfElement = this.document.getMapper().mapElement(container);
rtfElement.setInTable(true);
this.content.add(rtfElement);
} catch(DocumentException de) {
de.printStackTrace();
}
}