Home  >  Q&A  >  body text

Create uniform height for side-by-side tables in HTML CSS

<p>I have two or more different tables that are generated by a php loop; I want them all to have the same<li>item height for each table with different text:</p> <p><br /></p> <pre class="brush:html;toolbar:false;"><div class="table-1"> <ul> <li>short text1</li> <li>short text1</li> <li>long text1 long text1 long text1 long text1 long text1 long text1 </li> <li>short text1</li> </ul> </div> <div class="table-2"> <ul> <li>short text2</li> <li>long text2 long text2 long text2 long text2 long text2 long text2 </li> <li>short text2</li> <li>short text2</li> <li>short text2</li> </ul> </div></pre> <p><br /></p>
P粉044526217P粉044526217445 days ago342

reply all(1)I'll reply

  • P粉134288794

    P粉1342887942023-08-02 00:25:40

    Not sure if this is what you want but you can easily set the height of all li items by adding li {height: 40px} in CSS

    Or see the example https://codepen .io/oldskool123/pen/poQqxVK

    reply
    0
  • Cancelreply