2017-05-22 133 views
0

我嘗試整理顯示窗體。顯示窗體很凌亂

頁面由2 colomn分開。但是當我輸入很多值或選擇時,顯示很混亂。我必須在任何地方設置「}」,但不起作用。

這是截圖:enter image description here

這是代碼:

<h3 class="form-section">Data Kegiatan</h3> 
<div class="row"> 
    <div class="col-md-6"> 
     <div class="form-group"> 
     <label class="control-label col-md-3"><b>Nama Proposal :</b></label> 
     <div class="col-md-9"> 
      <p class="form-control-static"> <?php echo $proposalName; ?></p> 
     </div> 
     </div> 
    </div> 
    <!--/span--> 
    <div class="col-md-6"> 
     <div class="form-group"> 
     <label class="control-label col-md-3"><b>Jenis Bantuan :</b></label> 
     <?php 
      $no=0; 
      $stmt = $reg_user->runQuery("SELECT * FROM tbl_proposal_detail_jenis_bantuan WHERE proposalID='".$_GET['id']."'"); 
      $stmt->execute(); 
      $stmt->setFetchMode(PDO::FETCH_OBJ); 
      while($new_arr=$stmt->fetch()){ 
       $stmt2 = $reg_user->runQuery("SELECT * FROM tbl_jenis_bantuan WHERE jenisBantuanID='".$new_arr->jenisBantuanID."'"); 
       $stmt2->execute(); 
       $stmt2->setFetchMode(PDO::FETCH_OBJ); 
       while($data=$stmt2->fetch()){ 
        $no++; 
      ?> 
     <div class="col-md-9"> 
      <p class="form-control-static"> <?php echo $no.". ". $data->Name;?></p> 
     </div> 
     <?php }} ?> 
     </div> 
    </div> 
    <!--/span--> 
</div> 
<!--/row--> 
<div class="row"> 
    <div class="col-md-6"> 
     <div class="form-group"> 
     <label class="control-label col-md-3"><b>Detail Bantuan:</b></label> 
     <div class="col-md-9"> 
      <p class="form-control-static"> <?php echo $supportDetail; ?> </p> 
     </div> 
     </div> 
    </div> 
    <!--/span--> 
    <div class="col-md-6"> 
     <div class="form-group"> 
     <label class="control-label col-md-3"><b>Sub Sektor:</b></label> 
     <?php 
      $no=0; 
      $stmt = $reg_user->runQuery("SELECT * FROM tbl_proposal_detail_sub_sektor WHERE proposalID='".$_GET['id']."'"); 
      $stmt->execute(); 
      $stmt->setFetchMode(PDO::FETCH_OBJ); 
      while($new_arr=$stmt->fetch()){ 
       $stmt2 = $reg_user->runQuery("SELECT * FROM tbl_sub_sektor WHERE subSektorID='".$new_arr->subSektorID."'"); 
       $stmt2->execute(); 
       $stmt2->setFetchMode(PDO::FETCH_OBJ); 
       while($data=$stmt2->fetch()){ 
        $no++; 
      ?> 
     <div class="col-md-9"> 
      <p class="form-control-static"> <?php echo $no.". ".$data->subSektorName;?></p> 
     </div> 
     </div> 
     <?php }} ?> 
    </div> 
    <!--/span--> 
</div> 

回答

0

試圖把所有這些標籤標記一個div容器東西作爲內:

<div class = "col-md-3"> 
    <label class="control-label"><b>Detail Bantuan:</b></label> 
<div> 
<div class="col-md-9"> 
    <p class="form-control-static"> <?php echo $no.". ". $data->Name;?></p> 
</div> 

這只是一個例子,把所有這些標籤放在"col-md-3"容器中。這應該工作。

+0

謝謝@Saroj Shrestha –

0

這是原因:

本準則

<div class="col-md-9"> 

是包括循環。我只是將這些代碼從循環中取出。和它的工作。謝謝!