class Hpdf::Table
- Hpdf::Table
- Reference
- Object
Overview
The table is the container for Row
, which contain Cell
.
Defined in:
hpdf/table.crConstructors
-
.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
-
.new(rect : Rectangle, *, spacing : Number = 0, fixed_row_height : Number = 0)
creates a new table using the given rect
Instance Method Summary
-
#add_row(row : Row)
adds the row to the end (bottom) of the table
-
#calc!
calculates the rectangles of all rows and cells respectively
- #rect : Hpdf::Rectangle
- #rect=(rect : Hpdf::Rectangle)
-
#render(page : Page, &block : Table | Row | BaseCell, Symbol -> )
render will call cell rendering for all cells.
-
#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
-
#row_count
returns the number of rows
-
#row_height(row)
returns the height of each row
- #rows : Array(Hpdf::Row)
- #rows=(rows : Array(Hpdf::Row))
- #spacing : Float32
- #spacing=(spacing : Float32)
Constructor Detail
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
creates a new table using the given rect
- spacing spacing between the cells, by default there is no spacing
Instance Method Detail
render will call cell rendering for all cells. Then it will render the rectangles for the cell, row and table using the passed function
creates a rows and yields the block with the newly created row and adds it to the end (bottom) of the table