Stop table container from expanding itself to fit absolute nested children
Hello, I have a table that has a column that contains a button that expands a text element. First 2 screenshots show what it looks like before button is clicked and after it's clicked and text is shown.
I'm using Vue to show/hide element with v-if, so it's either in the DOM or not, no
display
display
being changed.
As you can see when the text is expanded the table container (pink) expands to fit it, screenshots 3 and 4 show before click and after of inspector elements. The table stays the same size but parent div expands to fit my added absolutely positioned element.
How can I make it stay the same size of purely table rows and not expand when my text block is being shown?
Here's an approximate snippet the table structure seen in screenshots.
<div class="overflow-auto bg-pink-200"> <table> <thead>...</thead><tbody> <tr> ... <td> <div class="relative"> <!-- expand button --> <div class="absolute"> <!-- some other elements --> <div> here be text content </div> </div> </div> </td> </tr></tbody> </table></div>
<div class="overflow-auto bg-pink-200"> <table> <thead>...</thead><tbody> <tr> ... <td> <div class="relative"> <!-- expand button --> <div class="absolute"> <!-- some other elements --> <div> here be text content </div> </div> </div> </td> </tr></tbody> </table></div>
Similar Threads
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community
KP-C
Kevin Powell - Community
A friendly place for developers to meet other devs, ask questions, get help, and just have a good time 🙂.