Skip to content

Latest commit

 

History

History
79 lines (46 loc) · 1.28 KB

table.md

File metadata and controls

79 lines (46 loc) · 1.28 KB

Table

.tr([opts])

This method can be used place tables. Returns a Row object.

Arguments:

  • opts - styling options

Options:

.beforeBreak([opts])

Same as table.tr([opts]), but the created row is only rendered before table page breaks.

.beforeBreak(fn)

Create a dynamic before pagebreak row.

Arguments:

  • fn - function called, when creating the before pagebreak row

Example:

table.beforeBreak(function(row, i) {
    row.td('BEFORE idx: ' + i)
})

Row

Table row.

.td([text], [opts])

This method can be used place tables. Returns a Row object.

Arguments:

  • text - the cell's text content
  • opts - styling options

Options:

  • colspan (default: 1) - through how many columns the cell should span
  • height

Cell

Table cell.

Example:

var td = tr.td()
td.text('Foo')
td.text('Bar')
td.image(img)

.text([text], [opts])

Same as doc.text([text], [opts])

.table([opts])

Same as doc.table([opts])

.image(img, [opts])

Same as doc.image(img, [opts])