我试着整理显示表格。
页面由2个colomn分开。但是当我输入许多值或选择时,显示都很混乱。我必须设置"}"在任何地方,但没有工作。
这是屏幕截图:
这是代码:
<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 :(得分: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"
容器中的示例。这应该有用。
答案 1 :(得分:0)
这是原因:
本守则
<div class="col-md-9">
包含在循环中。我只是把代码从循环中取出来。和它的工作。谢谢!