Dynamic page with JavaScript and multiple buttons

Hello,

I am struggle with this requirement. Can you please give me some ideas? Thank you.

In a page there are multiple hyperlinks/button in a table.
Each hyperlink/button can have more than 1 PDF files
When clicked on hyperlink/button, the page should show what text /button is clicked with PDF icons based on no. of files.
when clicked on PDF icon it should open corresponding PDF files.

In other words, I am trying to mimic like share point. Click on button it should lists all PDF files associated with the topic. Please help.

Thanks