JSFiddle - React, Tailwind, and code Playground
HTML
<a href="#test">Toggle hidden DIV with display: table</a>
<div id="test" class="cssTable">
<p>Some</p>
<p>Text</p><br>
<p>test</p>
</div>
<hr />
<a href="#test2">Toggle visible DIV with display: table</a>
<div id="test2" class="cssTable">
<p>Some</p>
<p>Text</p>
</div>
CSS
.cssTable {
display: table;
background: grey;
}
.cssTable p {
display: table-cell;
}
#test {
display: none;
}
JavaScript
$().ready(function() {
$("a").click(function() {
$(this).next().slideToggle();
})
});