title: How can one create horizontal tree view using CSS and HTML?
body: <p>thanks for your interest, first I believe image is worth thousand word, so here you go 
  <img src="https://i.stack.imgur.com/tBbvy.gif" alt="This is kind of what I am trying to achieve"></p>
  
  <p>Unfortunately I am not in possession of mouse right now, so its drawn using IBM TrackPoint, but the main idea should be clear.
  I called it horizontal tree because usually tree view is vertical, you would only see one directory on one line and on the left hand side of the directory name would be just vertical lines showing how deeply nested this directory is. I am trying to have "directories" listed next to each other.</p>
  
  <p>Think of it as of algorithm diagram with IFs and ENDIFs and they will always have exactly two outputs or inputs.</p>
  
  <p><strong>Now, I am trying to construct this with basic HTML elements and CSS and I thought at first that it will be piece of cake but it isn't, I spent whole afternoon on it with no luck. It will be generated by JS dynamically so I am trying to avoid tables. There could me any number of IFs, there will be exactly same amount of ENDIFs. There will be any number of other basic cells. The whole structure starts with one cell and ends with one cell</strong></p>
  
  <p>Here is html that should generate similiar picture:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;IFs and ENDIFs&lt;/title&gt;
  &lt;style&gt;
  ul, li, div{
      margin: 0px;
      padding: 0px;
      border: 0px;
      }
  ul.left{
      border: 1px solid red;
      margin: 2px;
      padding: 2px;
      list-style-type:none;
      width: 150px;
      float:left;
      }
  ul.right{
      border: 1px solid green;
      margin: 2px;
      padding: 2px;
      list-style-type:none;
      width: 150px;
      float:left;
      }
  
  }
  li.parent{
      border: 1px solid blue;
      background-color:#CC9;
      margin: 2px;
      padding: 2px;
      min-width: 350px;
      display:block;
      overflow-style:marquee-block;
      }
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="root"&gt;
      &lt;ul&gt;
          &lt;li class="parent"&gt;
              &lt;div class="label"&gt;1&lt;/div&gt;
              &lt;ul class="left"&gt;
                  &lt;li&gt;    
                      &lt;div class="label"&gt;1.L1&lt;/div&gt;
                  &lt;/li&gt;
                  &lt;li&gt;
                      &lt;div class="label"&gt;1.L2&lt;/div&gt;
                  &lt;/li&gt;
                  &lt;li class="parent"&gt;
                      &lt;div class="label"&gt;1.L3&lt;/div&gt;
                      &lt;ul class="left"&gt;
                          &lt;li&gt;    
                              &lt;div class="label"&gt;1.L3.L1&lt;/div&gt;
                          &lt;/li&gt;
                      &lt;/ul&gt;
                      &lt;ul class="right"&gt;
                          &lt;li&gt;    
                              &lt;div class="label"&gt;1.L3.R1&lt;/div&gt;
                          &lt;/li&gt;
                          &lt;li&gt;
                              &lt;div class="label"&gt;1.L3.R2&lt;/div&gt;
                          &lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;
              &lt;ul class="right"&gt;
                  &lt;li&gt;
                      &lt;div class="label"&gt;1.R1&lt;/div&gt;
                  &lt;/li&gt;
                  &lt;li&gt;
                      &lt;div class="label"&gt;1.R2&lt;/div&gt;
                  &lt;/li&gt;
                  &lt;li class="parent"&gt;
                      &lt;div class="label"&gt;1.R3&lt;/div&gt;
                      &lt;ul class="left"&gt;
                          &lt;li&gt;    
                              &lt;div class="label"&gt;1.R3.L1&lt;/div&gt;
                          &lt;/li&gt;
                          &lt;li&gt;
                              &lt;div class="label"&gt;1.R3.L2&lt;/div&gt;
                          &lt;/li&gt;
                          &lt;li&gt;
                              &lt;div class="label"&gt;1.R3.L3&lt;/div&gt;
                          &lt;/li&gt;
                          &lt;li&gt;
                              &lt;div class="label"&gt;1.R3.L4&lt;/div&gt;
                          &lt;/li&gt;
                      &lt;/ul&gt;
                      &lt;ul class="right"&gt;
                          &lt;li&gt;    
                              &lt;div class="label"&gt;1.R3.R1&lt;/div&gt;
                          &lt;/li&gt;
                          &lt;li&gt;
                              &lt;div class="label"&gt;1.R3.R2&lt;/div&gt;
                          &lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;
          &lt;/li&gt;
          &lt;li&gt;
              &lt;div class="label"&gt;2&lt;/div&gt;
          &lt;/li&gt;
          &lt;li&gt;
              &lt;div class="label"&gt;3&lt;/div&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is what it looks like so far :( (nothing near the result i hope for, also this is probably 7th iteration of me trying to figure this out) So if anyone could point me in the right direction I would really appreciate it.
  <img src="https://i.stack.imgur.com/hGUJn.png" alt="enter image description here"></p>