Example usage for com.itextpdf.text.pdf PdfPTable setHorizontalAlignment

List of usage examples for com.itextpdf.text.pdf PdfPTable setHorizontalAlignment

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf PdfPTable setHorizontalAlignment.

Prototype

public void setHorizontalAlignment(final int horizontalAlignment) 

Source Link

Document

Sets the horizontal alignment of the table relative to the page.

Usage

From source file:WeeklyReport.WeeklyPDF.java

public static PdfPTable header() {
    PdfPTable table = new PdfPTable(1);
    table.setHorizontalAlignment(Element.ALIGN_MIDDLE);
    table.setWidthPercentage(100f);//from  w ww . j ava  2 s. c  o  m

    cell = new PdfPCell(new Phrase("RQS Report", HEADING_FONT));
    cell.setColspan(1);
    cell.setBorder(Rectangle.NO_BORDER);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Week: " + new ReportingDates().reportPeriod(), SUBHEADING_FONT));
    cell.setColspan(1);
    cell.setBorder(Rectangle.BOTTOM);
    table.addCell(cell);

    return table;
}