react-component / react-component/table

expandedRowRender and colspan

Open
#1,164 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.4k
Forks
618
Avg merge
10h 19m
Merged PRs (30d)
2

Description

Hi,

I am rendering a table, which has an expandedRowRender: (record) => <ExpandedLazyLoadedRow record={record} />, function to render a component once data is fetched from the api.

Currently the table renders like

image

What I am trying to do is render the td instead of this

<tr class="rc-table-expanded-row rc-table-expanded-row-level-1">
  <td class="rc-table-cell" colspan="6">
      <div style="display: flex;">
        <div style="flex: 1 1 0%; padding-right: 8px;">Expanded Content 1 (colspan 2)</div>
        <div style="flex: 3 1 0%;">Expanded Content 2 (colspan 4)</div>
      </div>
  </td>
</tr>

to

<tr class="rc-table-expanded-row rc-table-expanded-row-level-1">
  <td class="rc-table-cell" colspan="2">
      Some content
  </td>
  <td class="rc-table-cell" colspan="4">
      Some content
  </td>
</tr>

So that it aligns correctly with the parent column. Any inputs is really appreciated.

Thank you.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing expandedRowRender through the expanded-row rendering path and checking how the current colspan is assigned. Confirm whether the existing API can produce multiple cells aligned with parent columns; done means expanded content renders in separate cells with the requested colspans and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.