Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Antd: Is it possible to move the table row expander inside one of the cells?

Tags:

reactjs

antd

I have an antd table where the data inside one of the columns can get pretty large. I am showing this data in full when the row is expanded but because the cell with a lot of data is on the right side of the screen and the expander icon is on the left side of the screen it is not very intuitive. What I would like to do is move the expander icon inside the actual cell so that the user knows they can click the + to see the rest of the data.

Thanks in advance.

like image 882
llevar Avatar asked Oct 21 '17 20:10

llevar


1 Answers

Yes, you can and you have to dig a little deeper their docucmentation...

According to rc-table docs you can use expandIconColumnIndex for the index column you want to add the +, also you have to add expandIconAsCell={false} to make it render as part of the cell.

See Demo

like image 137
Yichaoz Avatar answered Nov 09 '22 08:11

Yichaoz