if (options.isPrintHeaders() && table.getColumns() != null) {
beforeHeaderRow(table);
for (int i = 0; i < table.getColumns().size(); i++) {
HeaderCellDetails headerCellDetails = new HeaderCellDetails(table, i);
beforeHeaderCell(headerCellDetails);
writeHeaderCell(headerCellDetails);
afterHeaderCell(headerCellDetails);
}