Need help in designing the table

I created the table having 5 column, so on last column I have button, when I click on button the div should display and cover the whole row. The problem I am facing is, the div is only showed in the current 5 column, I want the div cover the whole row (tr) Design I want to achieve in pic;
18 Replies
Mozi47
Mozi47OP2y ago
code:
Mozi47
Mozi47OP2y ago
Jochem
Jochem2y ago
you're much more likely to find someone who is willing to help if you include a live demo, or at the very very least your code in a codeblock instead of just posting a screenshot check out #How To Ask Good Questions
Mozi47
Mozi47OP2y ago
ok sorry for that
Zoë
Zoë2y ago
I don't know Tailwind so I don't know exactly what top-12 means, but I think it should be 0, same with left and right if you want it to cover the entire row No code to play around with makes it difficult to diagnose, so that's all I've got Just copying the HTML that is produced and the resources required to make it display as you see it is all that's really required, don't need to set up everything
Mozi47
Mozi47OP2y ago
https://codesandbox.io/s/clever-christian-7unckn?file=/src/App.js Sorry. Now here is the link of sandbox well top is basically css property and 12 (3rem) sorry for incomplete info. Sandbox link attached
Zoë
Zoë2y ago
It looks like when you click the Log button it opens the modal in the first row, not the model on the row that was clicked
Mozi47
Mozi47OP2y ago
Yes. I dont want model. that was just for understanding. basically I want, when the log is clicked, the div display below and cover full width I am confused how to achieve it
Zoë
Zoë2y ago
I changed top-4 to top-0 and I get what I think you're describing, it completely covers the row
Mozi47
Mozi47OP2y ago
Write now the model way is not working , basically the content should expand and collapse write now the model is stacked over the rows
Mozi47
Mozi47OP2y ago
Mozi47
Mozi47OP2y ago
I want like this I think its not possible with table I have to used div. May be I am wrong
Zoë
Zoë2y ago
Ah I see, hmm. It's possible but I don't know how elegant it can be achieved I need a quick reminder on tables because I've just been using CSS Grid for everything tables
Mozi47
Mozi47OP2y ago
I tried with table but the sapce it covers only last column width. Full is bit tricky I think I have to do the same for this as well
Zoë
Zoë2y ago
Add a new row under the row you want to see the logs for and then have a <td colspan="5"> with the modal inside https://codepen.io/z-/pen/abRVVWg/8129731db56e7c610ae5aa58e3ecaab3
Zoë
Zoë2y ago
I see that you have column sorting, you may want to hide all modals when you click one Actually no it should work if it's tied to the original row
Mozi47
Mozi47OP2y ago
Thanks this works.
Mozi47
Mozi47OP2y ago
Want results from more Discord servers?
Add your server