#Working With Dynamic Table if no data

7 messages · Page 1 of 1 (latest)

proven moat
#

Im working with the dynamic table and noticed that there isnt much info on how to so show a message in the body of the Table if the data.length is 0. Because the body.cell must match the number of columns, is there a work around for this? Thanks

shy pebble
#

you can add this on tableBody example

<TableBody
  emptyContent={"No data to display."}
  items={data}
>
  {(item) => (
    <TableRow key={item.id}>
      {(columnKey) => <TableCell>{renderCell(item, columnKey)}</TableCell>}
    </TableRow>
  )}
</TableBody>
#

this work show message if the data.lenght is 0

proven moat
#

Hi @shy pebble , emptyContent does not exist in this context

shy pebble
proven moat