5

Any idea how to use rowSpan in react table. for below example usernameFormatter there are multiple values. Note: attach picture is copied but that's looks like what I wanted

const columns = [
     {
         accessor: "id",
         show: false,
     },
     {
        Header: "Username",
        id: "username",
        accessor: "username",
        Cell: this.usernameFormatter,
        enableRowSpan: true
     }
]
          
<ReactTable
    data={this.state.users}
    filterable={true}
    columns={columns}
    defaultPageSize={18}
    getTdProps={(state, rowInfo, column) => {
        const index = rowInfo ? rowInfo.index : -1;
        return {
            onClick: (e, handleOriginal) => {
                if (column.Header === undefined) {
                    handleOriginal();
                } else {
                    if (rowInfo !== undefined) {
                        this.selectedRow = index;
                        this.onRowSelect(rowInfo.original.id);
                    }
                }
            },
        };
    }}
/>
                

enter image description here

Oshini
  • 613
  • 4
  • 17
  • Does this answer your question? [HTML table rowspan in reactjs](https://stackoverflow.com/questions/70872995/html-table-rowspan-in-reactjs) – poPaTheGuru May 15 '23 at 07:39

0 Answers0