PDFTable

public class PDFTable : PDFDocumentObject

A table is a two dimensional list. It can be styled and can contain different data.

  • Styling used for drawing

    Declaration

    Swift

    public var style: PDFTableStyle
  • All cell data

    Declaration

    Swift

    public var cells: [[PDFTableCell]]
  • List of relative widths. Values are between 0.0 and 1.0 and should sum up to 1.0

    Declaration

    Swift

    public var widths: [CGFloat]
  • Padding is the distance between the cell content and its borders.

    Declaration

    Swift

    public var padding: CGFloat
  • Margin is the distance between the cell borders and other cells

    Declaration

    Swift

    public var margin: CGFloat
  • Header rows will be drawn on every page

    Declaration

    Swift

    public var showHeadersOnEveryPage: Bool
  • Cells should split when overlapping page

    Declaration

    Swift

    public var shouldSplitCellsOnPageBreak: Bool
  • Count of rows and columns in this table

    Declaration

    Swift

    public private(set) var size: (rows: Int, columns: Int) { get }
  • Creates a new table with the given size and populates it with empty cells

    Declaration

    Swift

    public convenience init(size: (rows: Int, columns: Int))

    Parameters

    size

    Row and column count of table

  • Creates a new table with the given size and populates it with empty cells.

    Declaration

    Swift

    public init(rows: Int, columns: Int)

    Parameters

    rows

    Rows of table, must be greater than 0

    columns

    Columns of table, must be greater than 0

  • Undocumented

    Declaration

    Swift

    public var rows: PDFTableRows { get }
  • Undocumented

    Declaration

    Swift

    public var columns: PDFTableColumns { get }
  • Undocumented

    Declaration

    Swift

    public var content: [[PDFTableContentable?]] { get set }
  • Undocumented

    Declaration

    Swift

    public var alignment: [[PDFTableCellAlignment]] { get set }

Equatable

  • Compares two instances of PDFTable for equality

    Declaration

    Swift

    override public func isEqual(to other: PDFDocumentObject) -> Bool

    Parameters

    other

    Another instance of PDFTable

    Return Value

    true, if attributes, tag, style, cells, widths, padding, margin, showHeadersOnEveryPage equal; otherwise false

  • Accessor for a specific cell at the given position

    Declaration

    Swift

    public subscript(position position: PDFTableCellPosition) -> PDFTableCell { get set }

    Parameters

    row

    Index of row

    column

    Index of column

    Return Value

    cell at given indicies

  • Accessor for a specific cell at the given position

    Declaration

    Swift

    public subscript(row: Int, column: Int) -> PDFTableCell { get set }

    Parameters

    row

    Index of row

    column

    Index of column

    Return Value

    cell at given indicies

  • Accessor for a specific column

    Declaration

    Swift

    public subscript(column index: Int) -> PDFTableColumn { get set }

    Parameters

    column

    Index of column

    Return Value

    PDFTableColumn with references to cells of this table

  • Accessors of columns in the given range.

    Declaration

    Swift

    public subscript(columns range: ClosedRange<Int>) -> PDFTableColumns { get set }

    Parameters

    columns

    Range of indicies

    Return Value

    PDFTableColumns with references to columns

  • Accessors of columns in the given range.

    Declaration

    Swift

    public subscript(columns range: PartialRangeFrom<Int>) -> PDFTableColumns { get set }

    Parameters

    columns

    Range of indicies

    Return Value

    PDFTableColumns with references to columns

  • Accessors of columns in the given range.

    Declaration

    Swift

    public subscript(columns range: PartialRangeThrough<Int>) -> PDFTableColumns { get set }

    Parameters

    columns

    Range of indicies

    Return Value

    PDFTableColumns with references to columns

  • Accessors of columns in the given range.

    Declaration

    Swift

    public subscript(columns range: PartialRangeUpTo<Int>) -> PDFTableColumns { get set }

    Parameters

    columns

    Range of indicies

    Return Value

    PDFTableColumns with references to columns

  • Accessors of columns in the given range.

    Declaration

    Swift

    public subscript(columns range: Range<Int>) -> PDFTableColumns { get set }

    Parameters

    columns

    Range of indicies

    Return Value

    PDFTableColumns with references to columns

  • Accessor for a specific row

    Declaration

    Swift

    public subscript(row index: Int) -> PDFTableRow { get set }

    Parameters

    row

    Index of row

    Return Value

    PDFTableRow with references to cells of this table

  • Accessors of rows in the given range.

    Declaration

    Swift

    public subscript(rows range: ClosedRange<Int>) -> PDFTableRows { get set }

    Parameters

    rows

    Range of indicies

    Return Value

    PDFTableRows with references to rows

  • Accessors of rows in the given range.

    Declaration

    Swift

    public subscript(rows range: PartialRangeFrom<Int>) -> PDFTableRows { get set }

    Parameters

    rows

    Range of indicies

    Return Value

    PDFTableRows with references to rows

  • Accessors of rows in the given range.

    Declaration

    Swift

    public subscript(rows range: PartialRangeThrough<Int>) -> PDFTableRows { get set }

    Parameters

    rows

    Range of indicies

    Return Value

    PDFTableRows with references to rows

  • Accessors of rows in the given range.

    Declaration

    Swift

    public subscript(rows range: PartialRangeUpTo<Int>) -> PDFTableRows { get set }

    Parameters

    rows

    Range of indicies

    Return Value

    PDFTableRows with references to rows

  • Accessors of rows in the given range.

    Declaration

    Swift

    public subscript(rows range: Range<Int>) -> PDFTableRows { get set }

    Parameters

    rows

    Range of indicies

    Return Value

    PDFTableRows with references to rows

Single Row

Range

Closed Range

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows rows: ClosedRange<Int>, columns columns: Range<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows rows: ClosedRange<Int>, columns columns: ClosedRange<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows rows: ClosedRange<Int>, columns columns: PartialRangeFrom<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows rows: ClosedRange<Int>, columns columns: PartialRangeThrough<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows rows: ClosedRange<Int>, columns columns: PartialRangeUpTo<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of column in the given rows

    Declaration

    Swift

    public subscript(rows rows: ClosedRange<Int>, column column: Int) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    column

    Single row index

    Return Value

    PDFTableSection with references to cells

Partial Range From

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows rows: PartialRangeFrom<Int>, columns columns: Range<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows rows: PartialRangeFrom<Int>, columns columns: ClosedRange<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows rows: PartialRangeFrom<Int>, columns columns: PartialRangeFrom<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows rows: PartialRangeFrom<Int>, columns columns: PartialRangeThrough<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows rows: PartialRangeFrom<Int>, columns columns: PartialRangeUpTo<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of column in the given rows

    Declaration

    Swift

    public subscript(rows rows: PartialRangeFrom<Int>, column column: Int) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    column

    Single row index

    Return Value

    PDFTableSection with references to cells

Partial Range Up To

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows rows: PartialRangeUpTo<Int>, columns columns: Range<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows rows: PartialRangeUpTo<Int>, columns columns: ClosedRange<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows rows: PartialRangeUpTo<Int>, columns columns: PartialRangeFrom<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows rows: PartialRangeUpTo<Int>, columns columns: PartialRangeThrough<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows rows: PartialRangeUpTo<Int>, columns columns: PartialRangeUpTo<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells

  • Accessors of column in the given rows

    Declaration

    Swift

    public subscript(rows rows: PartialRangeUpTo<Int>, column column: Int) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    column

    Single row index

    Return Value

    PDFTableSection with references to cells

  • Accessors of cells in the given rows and columns range.

    Declaration

    Swift

    public subscript(rows rows: Range<Int>, columns columns: Range<Int>) -> PDFTableSection { get set }

    Parameters

    rows

    Range of indicies

    columns

    Range of indicies

    Return Value

    PDFTableSection with references to cells