Building the Table
You can build your cols()
and rows()
with a compact syntax.
You can also declare columns as objects. The objects have a label
property.
This will come in handy when we need to assign extra properties to the
columns. If we set the type
property to ts-number
,
the text will be right-aligned (except in the first column).
We can also declare rows as objects with a list of cells
. This syntax will allow us to mark the row as selected
(you can read more about selection).
The individual cells can also be declared as objects if the displayed text
should be different from the hidden value
(which can be anything you like).
You can update a single row whenever you like. Here with compact syntax.
You can of course also update a single cell. Here with compact syntax:
You can use array methods like push, pop, shift, unshift, splice, reverse and so on to mange the rows. Just note that the length
property is readonly.
Here' a summary of the methods that deal with building the Table.