title: How to change <div> property of certain content panel in a php webpage?
body: <pre><code>&lt;div class="row"&gt;
      &lt;div class="col-md-10 col-md-offset-1"&gt;
          &lt;div class="row text-center"&gt;
  
      &lt;?php
      if($_GET[id] == 0)
      {
          $querysb = mysql_query("SELECT  * FROM services WHERE parentid !=0 order by parentid, cid ");
      }
      else
      {
          $querysb = mysql_query("SELECT  * FROM services WHERE parentid='".$_GET[id]."'");
      }
      while($rowsb = mysql_fetch_assoc($querysb))
      {
          if($val == '6' || $val =='10'){
              $classname = 'whitebg';
          } else {
              $classname = 'bg-blue co-white';
          }
      ?&gt;
  
            &lt;div class="col-md-4 mrgnBtm15"&gt;
              &lt;div class="&lt;?php echo $classname;?&gt; padding30" style="min-height: 250px"&gt;
               &lt;h3 class="service-heading"&gt;
                  &lt;?php echo $rowsb['cname'];?&gt;
                &lt;/h3&gt;
                &lt;h4&gt;
                  RS &lt;?php echo $rowsb['price'];?&gt;&lt;br&gt;
                &lt;/h4&gt;
                &lt;div class="mrgnTop15 clearfix"&gt;&lt;/div&gt;
  
                &lt;a  class="btn bg-orange co-white" href="&lt;?php echo MYWEBSITE;?&gt;servicedetail/&lt;?php echo to_prety_url($rowsb['cname']).'-'.$rowsb['cid'];?&gt;.html"&gt;
                    &lt;font style="size:14px; color:#000; font-weight:bolder;font-family: "Open Sans";"&gt;Register&lt;/font&gt;&lt;/a&gt;
  
              &lt;/div&gt;
            &lt;/div&gt;
  &lt;?php } ?&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>I am working on a dynamic website. here is the code of a particular page. In this page there is a div section with class="col md-4". If the number of content panel in that division appears to <strong>5</strong> or <strong>7</strong> in that case I want <strong>only</strong> the last panel (i.e 5th and 7th) to be in full column (col-12). What should I do? </p>