title: check if table cell is empty using php
body: <p>can I check table cell is empty or not by using PHP? 
  I am doing a report using for loop, when the section didn't filled up it will not display the table so it made the table looks weird.<a href="https://i.stack.imgur.com/w8BGZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w8BGZ.png" alt="so if they didn&#39;t filled one of the section, it will display in this way."></a> </p>
  
  <pre><code>    echo"&lt;table width='100%' border='3' class='table table-striped' style='font-size:12px;'&gt;";
  
      for($i=0;$i&lt;$num_results;$i++){
      $row = $result-&gt;fetch_array();
      $totalsum=0;
  
      $query5 = "SELECT * FROM outlet_type_location WHERE id = '$row[outlet_type_location_id]'";
      $result5 = $db-&gt;query($query5);
      $row5 = $result5-&gt;fetch_array();
  
      echo"&lt;tr&gt;";
      echo"&lt;th width='15%'&gt;".$row5['location']."&lt;/th&gt;";
  
      $query2 = "SELECT section_mark FROM audit_section_section_mark WHERE audit_section_no = '$row[audit_no]'";
      $result2 = $db-&gt;query($query2);
      $num_results2 = $result2-&gt;num_rows; 
  
      for($j=0;$j&lt;$num_results2;$j++){
      $row2 = $result2-&gt;fetch_array();
  
      $ss_mark = $row2['section_mark'];
  
      echo"&lt;td width='10%' align='center' id='my_cell'&gt;$ss_mark&lt;/td&gt;";
      }
  
      //listing total result
      echo"&lt;td width='10%' align='center'&gt;";
      if($totalsum &lt; 70){
          echo"&lt;font color='red'&gt;&lt;b&gt;$totalsum/100&lt;/b&gt;&lt;/font&gt;"; 
      }else if($totalsum &gt;= 80){
          echo"&lt;font color='#00CC33'&gt;&lt;b&gt;$totalsum/100&lt;/b&gt;&lt;/font&gt;"; 
      }
      else{
          echo"&lt;font&gt;&lt;b&gt;$totalsum/100&lt;/b&gt;&lt;/font&gt;";    
      }
  echo"&lt;/td&gt;";
  echo"&lt;/tr&gt;";
  }
  
  echo"&lt;/table&gt;";
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/w8BGZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w8BGZ.png" alt="enter image description here"></a></p>