class Hpdf::Table

Overview

The table is the container for Row, which contain Cell.

Defined in:

hpdf/table.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(x : Number, y : Number, width : Number, height : Number, *, spacing : Number = 0, fixed_row_height : Number = 0) #

creates a new table with the given coordinates and dimensions

  • spacing spacing between the cells, by default there is no spacing
  • fixed_row_height allows to specify the row height instead of calculation

[View source]
def self.new(rect : Rectangle, *, spacing : Number = 0, fixed_row_height : Number = 0) #

creates a new table using the given rect

  • spacing spacing between the cells, by default there is no spacing
  • fixed_row_height allows to specify the row height instead of calculation

[View source]

Instance Method Detail

def add_row(row : Row) #

adds the row to the end (bottom) of the table


[View source]
def calc! #

calculates the rectangles of all rows and cells respectively


[View source]
def rect : Hpdf::Rectangle #

[View source]
def rect=(rect : Hpdf::Rectangle) #

[View source]
def render(page : Page, &block : Table | Row | BaseCell, Symbol -> ) #

render will call cell rendering for all cells. Then it will render the rectangles for the cell, row and table using the passed function


[View source]
def row(&) #

creates a rows and yields the block with the newly created row and adds it to the end (bottom) of the table


[View source]
def row_count #

returns the number of rows


[View source]
def row_height #

returns the height of each row


[View source]
def rows : Array(Hpdf::Row) #

[View source]
def rows=(rows : Array(Hpdf::Row)) #

[View source]
def spacing : Float32 #

[View source]
def spacing=(spacing : Float32) #

[View source]