tablerec.setBorder(table.getBorder());
tablerec.setBorderWidth(table.getBorderWidth());
tablerec.setBorderColor(table.getBorderColor());
tablerec.setBackgroundColor(table.getBackgroundColor());
PdfContentByte under = writer.getDirectContentUnder();
under.rectangle(tablerec.rectangle(top(), indentBottom()));
under.add(ctx.cellGraphics);
// bugfix by Gerald Fehringer: now again add the border for the table
// since it might have been covered by cell backgrounds
tablerec.setBackgroundColor(null);
tablerec = tablerec.rectangle(top(), indentBottom());