这是我的数据库结构:
这是我当前的页面:
如何在具有特定ID的行后添加底部边距?
在此示例中,前两行( id 1
和2
)的下边距为~ 10px
;其余部分有下边距0px
码
echo "<div class='calc_container'>
<input type='hidden' class='id_3' name='id[]' value='".$row['ID']."'>
<input type='text' class='budget_3' name='Budget[]' value='".$row['Budget']."'>
<input type='text' class='avail_region_3' name='Availed_in_Regions[]' value='".$row['Availed_in_Regions']."'>
<input type='text' class='req_kbl_3' name='Requested_in_KBL[]' value='".$row['Requested_in_KBL']."'>
<input type='text' class='rec_kbl_3' name='Received_in_KBL[]' value='".$row['Received_in_KBL']."'>
<input type='text' class='avail_kbl_3' name='Availed_in_KBL[]' value='".$row['Availed_in_KBL']."'>
<input type='text' class='balance_3' name='Balance[]' value='".$row['Balance']."'>
</div>";}
答案 0 :(得分:1)
答案 1 :(得分:1)
你可以这样编码 -
echo "<div class='calc_container'"; if($row['ID']==1) echo " style='margin-bottom:10px;'"; echo ">
<input type='hidden' class='id_3' name='id[]' value='".$row['ID']."'>
<input type='text' class='budget_3' name='Budget[]' value='".$row['Budget']."'>
<input type='text' class='avail_region_3' name='Availed_in_Regions[]' value='".$row['Availed_in_Regions']."'>
<input type='text' class='req_kbl_3' name='Requested_in_KBL[]' value='".$row['Requested_in_KBL']."'>
<input type='text' class='rec_kbl_3' name='Received_in_KBL[]' value='".$row['Received_in_KBL']."'>
<input type='text' class='avail_kbl_3' name='Availed_in_KBL[]' value='".$row['Availed_in_KBL']."'>
<input type='text' class='balance_3' name='Balance[]' value='".$row['Balance']."'>
</div>";