title: Convert Flat Table list to Tree View
body: <p>Can anyone help creating any dynamic table list to Tree View (Parent/Child) etc.</p>
  
  <p><strong>Input :</strong></p>
  
  <p><code>
      TOTAL, NOT SPECIFIED     ALL CLASSES            NONE
      TOTAL, NOT SPECIFIED     WINTER                 NONE
      TOTAL, NOT SPECIFIED     SPRING, (EXCL DURUM)   NONE
      IRRIGATION METHOD        IRRIGATED              ALL CLASSES
      IRRIGATION STATUS        NON-IRRIGATED          ALL CLASSES
  </code></p>
  
  <p><strong>Expected Output :</strong> </p>
  
  <p><code>
      NONE
          TOTAL, NOT SPECIFIED 
                               ALL CLASSES
                               WINTER
                               SPRING, (EXCL DURUM)
      ALL CLASSES
          IRRIGATED 
                   IRRIGATION METHOD
          NON-IRRIGATED
                   IRRIGATION STATUS
  </code></p>
  
  <p>So this all should be dynamic and it can recur itself up to any level.</p>
  
  <p>On the other note I have this working alike but facing few bugs, Would appreciate if any javascript expert can make it flawless.</p>
  
  <p>Many Thanks.</p>