Note that there are some explanatory texts on larger screens.

plurals
  1. POFloat unordered lists (UL) next to one another, and stack them at the bottom of each other, with no margins or spaces
    primarykey
    data
    text
    <p>I have multiple unordered lists (UL) elements. Please check the image below:<img src="https://i.stack.imgur.com/4Pzj3.png" alt="multiple UL floated left... I want also the UL elements to stack at bottom of each other"></p> <p>what I want to do is float the ULs next to each other. The ULs have different lenghts of content (LIs), therefore some UL are longer than other. When I float ULs next to each other in a limited width div layer, at some point the last ULs float at the bottom / left. However... if there's a UL that is longer there will be some space. I wish the ULs to float left and to <em>stack</em> to each other, at the bottom of each UL element, without spaces. Is there a way to achieve this with HTML/CSS?</p> <p>floating ULs left of each other is easy... but I don't know how to get rid of the margin</p> <p>----- UPDATE ----</p> <p>this is the code I use to generate the HTML... actually I changed it from ULs to TABLEs but it doesn't change my problem. I have a number of TABLEs which may vary from 1 to 8. The width of the container DIV where these tables will appear can host up to 4 columns. The TABLEs will have different amounts of ROWs therefore will differ in lengths.</p> <pre><code>$groups = array(); foreach ($related-&gt;posts as $post) { $groups[$post-&gt;post_type][] = $post; } foreach ($groups as $name =&gt; $posts) { printf('&lt;table class="related-group related-%s "&gt;&lt;tbody&gt;', htmlspecialchars($name)); foreach ($posts as $post) { printf('&lt;tr class="related-item"&gt;&lt;td&gt;&lt;a href="'.get_permalink($post-&gt;ID).'" rel="permalink"&gt;'.get_the_post_thumbnail($post-&gt;id, '32').'&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;a href="'.get_permalink($post-&gt;ID).'" rel="permalink"&gt;'.$post-&gt;post_title.'&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;'); } echo '&lt;/tbody&gt;&lt;/table&gt;'; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload