columns

To define the columns of the table

  • optional (you can render a table without the header)
  • Type: string[] or TColumn[]
new Grid({
columns: ["Name", "Email", "Phone Number"]
});

or

new Grid({
columns: [{
name: "Name",
sort: true,
}, {
name: "Email"
}, {
name: "Phone Number",
width: '50%'
}]
});

TColumn type has the following properties:

NameDescriptionTypeExample
id optionalcolumn ID for JSON datastringphoneNumber
namecolumn namestringName
width optionalwidth of the columnstring200px or 30%
sort optionalto enable/disable sortbooleantrue or 0
formatter optionalcustom cell formattingfunction(cell: TCell, row: Row<TCell>, column: TColumn) => ComponentChild;
info

See Cell formatting example for more details.

Last updated on by Afshin Mehrabani