title: Dynamic row span php while loop
body: <p>i have two tables one item table and customer table:
  <a href="https://i.stack.imgur.com/hc4nA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hc4nA.jpg" alt="enter image description here"></a></p>
  
  <p>in the table you can see the second item item id 1002 have two entries.and i want to add colspan to that item for column 1 and 3.</p>
  
  <p><a href="https://i.stack.imgur.com/h7F6U.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h7F6U.jpg" alt="enter image description here"></a></p>
  
  <pre><code> &lt;table&gt;
    &lt;tr&gt;
      &lt;th&gt;Item ID&lt;/th&gt;
      &lt;th&gt;Item Color&lt;/th&gt;
      &lt;th&gt;Customer&lt;/th&gt;
    &lt;/tr&gt;
  &lt;?php
  $sql = mysqi_query($con,"select * from item_table");
  while($row = mysqli_fetch_array($sql)){
    ?&gt;
  
  &lt;tr&gt;
      &lt;td&gt;&lt;?=$row['item_id'];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?=$row['item_color'];?&gt;&lt;/td&gt;
      &lt;td&gt;
          &lt;select&gt;
          &lt;?php
          $sql_cust = mysqli_query($con,"select * from customer_tbl");
          while($row_cust = mysqli_fetch_array()){
          if($row['customer_id'] == $row_cust['customer_id']){
              echo "&lt;option selected='selected' &gt;".$row['customer_name']."&lt;/option&gt;";
          }else{
              echo "&lt;option&gt;".$row['customer_name']."&lt;/option&gt;";
          }
  
          &lt;?php
          }
          ?&gt;
          &lt;/select&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  
  
  &lt;?php
  }
  ?&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>But it print in normal way, i have no idea how to add rowspan in loop..please suggest some logic to solve its appreciated.</p>
  
  <p><a href="https://i.stack.imgur.com/8DeNv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8DeNv.jpg" alt="enter image description here"></a></p>