class

Hpdf::Table

Inherits Reference / Object

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

Constructors

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
Source
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
Source

Instance methods

add_row(row : Row)

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

Source
calc!

calculates the rectangles of all rows and cells respectively

Source
rect
Source
rect=(rect : Hpdf::Rectangle)
Source
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

Source
row(*, height = 0, allow_grow = false, &)

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

Source
row_count

returns the number of rows

Source
row_height(row)

returns the height of each row

Source
rows
Source
rows=(rows : Array(Hpdf::Row))
Source
spacing
Source
spacing=(spacing : Float32)
Source