title: How to set colspan dynamically using jquery?
body: <p>Hi i am displaying time tables. I want to add colspan dynamically to an element which contains string Lab. The table stored in database as follow:-</p>
  
  <pre><code>----------------------------------------------------------------------------------
  |    Day  | 9-10       | 10-11 | 11-12 | 12- 1| 1-2 |  2-3                |  3-4 |
  |---------------------------------------------------------------------------------
  | Monday  | DA601     | DA602 | DA603 |      |     | DA602 Lab/DA603 Lab  |      |
  | Tuesday | DA601 Lab |       |       |      |     | DA602 Lab/DA603 Lab  |      |
  ----------------------------------------------------------------------------------
  </code></pre>
  
  <p>So when the table is displayed in the application i want to colspan the lab entry so that it display in 2-3 and 3-4. I am unable to think of a way to do it. Kindly please provide a way to do it with javascript/jquery or any other technique.</p>
  
  <p>Table Display Code:-</p>
  
  <pre><code>&lt;table class="table table-bordered table-xxs"&gt;
      &lt;thead&gt;
          &lt;tr class="bg-info-600"&gt;
               &lt;th&gt;Day&lt;/th&gt;
               &lt;th&gt;9-10&lt;/th&gt;
               &lt;th&gt;10-11&lt;/th&gt;
               &lt;th&gt;11-12&lt;/th&gt;
               &lt;th&gt;12-1&lt;/th&gt;
               &lt;th&gt;1-2&lt;/th&gt;
               &lt;th&gt;2-3&lt;/th&gt;
               &lt;th&gt;3-4&lt;/th&gt;
          &lt;/tr&gt;
        &lt;/thead&gt;
  
        &lt;tbody&gt;
         &lt;?php 
              $sql="SELECT * FROM tt" ; 
              $results = $timetable-&gt;query($sql);
              while($row = $results-&gt;fetch_assoc()) 
              {
                  echo '&lt;tr&gt;'; 
                  echo "&lt;td&gt;{$row['day']}&lt;/td&gt;"; 
                  echo "&lt;td&gt;{$row['9-10']}&lt;/td&gt;"; 
                  echo "&lt;td&gt;{$row['10-11']}&lt;/td&gt;"; 
                  echo "&lt;td&gt;{$row['11-12']}&lt;/td&gt;"; 
                  echo "&lt;td&gt;{$row['12-1']}&lt;/td&gt;"; 
                  echo "&lt;td&gt;{$row['1-2']}&lt;/td&gt;"; 
                  echo "&lt;td&gt;{$row['2-3']}&lt;/td&gt;"; 
                  echo "&lt;td&gt;{$row['3-4']}&lt;/td&gt;"; 
                  echo '&lt;/tr&gt;';                       
              }
          ?&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
  </code></pre>