Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<?php
$mysqli = new mysqli("x", "xy", "xz", "db");
$kolom = 4;
$i=1;
$result = mysqli_query($mysqli, "SELECT * FROM daftar_penawaran");
while ($data = mysqli_fetch_array($result)) {
//if(($i) % $kolom== 1) {echo'<tr>';}
if(($i) % $kolom== 1) {echo '<div class="FourColumn">';}
    //echo '<td align="center" width="300px"> 
    echo '
        <p>'.$data['NoPenawaran'].'</p><br>
        <p>'.$data['JudulPenawaran'].'</p><br>';
    
$rowset = mysqli_query($mysqli, "select * from isi_penawaran where NoPenawaran='".$data['NoPenawaran']."'");
while ($rowsetdata = mysqli_fetch_array($rowset)) {
echo 
        //'<td align="center" width="300px"> 
        '<table>
        <tr>
        <td>'.$rowsetdata['IsiPenawaran'].'</td>
        <td>'.$rowsetdata['Nilai'].'</td>
        </tr>
        </table>';    
}
if(($i) % $kolom== 0) {echo'</div>';}
$i++;
}
?>


What I have tried:

One to many in div and show column model (side by side), but this script grow bottom, please help me any one
Posted
Updated 10-Jun-22 0:08am

1 solution

You need to set the positioning of each div element. See HTML DOM Style cssFloat Property[^].
 
Share this answer
 
Comments
radityo nugroho 10-Jun-22 6:19am    
how to implementation in div automatic at open windows?should i use jquery?
Richard MacCutchan 10-Jun-22 6:26am    
Sorry, I do not know the answer to that question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900