I want to make a web page that works by linking two tables in one page. What should I do?
The table above shows the top 7 companies in sales, and want to show detailed sales data in the table below.
g
great-boots-39022
02/13/2023, 2:02 PM
Unfortunately it's not possible to link two tables on the same page yet. The best way to do this now would be to set up a parameterized page for [company] and include a link column in your table which links to the parameterized page
👌 1
great-boots-39022
02/13/2023, 2:26 PM
Another way you could do it would be to use a loop underneath the top table and show the sales data for each of those 7 companies. If you include a header above each table in the loop, you can get it to appear in the table of contents on the page so your user can navigate to each company's section
b
brainy-raincoat-5393
02/13/2023, 9:30 PM
Thank you. I solved it using parameterized page.
🙌 1
b
bright-smartphone-11251
02/14/2023, 4:24 AM
There is a slightly fun workaround by which you can achieve the “two linked tables on one page”.
It uses a bit of undocumented functionality - query parameters.
Effectively you use links from the first table to create filters for the second, and then use an {#if} statement to conditionally show the filtered data in the second table.
See a working example here: https://stackblitz.com/edit/evidence-s3ze9f?file=pages%2Findex.md