1

I have a table and would like to give an option of whether you want to expand or collapse. If possible, I would also like to show the first 5 records in the table. I can make two separate tables and toggle, yes, but is there a more efficient way?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
MrM
  • 21,709
  • 30
  • 113
  • 139

1 Answers1

2

You can do this with JQuery easily by hiding/showing rows of the table. See this post to add a row with jQuery and this one for expanding and collapsing table rows.

The second link is no longer at this website. After doing a little searching on it, I found no new link. It appears to be deleted. There was nothing on the web page in the tutorials for jquery either. Apparent last post on this site is from 2017. Doesn't appear this is a good source anymore.

B'ajj
  • 15
  • 2
  • 5
Gergely Orosz
  • 6,475
  • 4
  • 47
  • 59