Wrote a code with page navigation, and information output: photo - nickname under the photo

$q="SELECT * FROM user ORDER BY nick LIMIT $start,$per_page"; $res = $connection->query($q); while($row = mysqli_fetch_array($res)) { echo '<div class=profile-bd>'; echo "<table>"; echo "<tr><td align=center><br><a href='bd.php?act=nick_info&id=".$row['id']."'><img src='".$row['photo_url']."' width='150' height='150' alt='Фото пользователя'></td></tr>"; echo "<tr><td align=center>".$row['nick']."<font color='#ffffff'></font></a></td></tr>"; echo '</table>'; echo '</div>'; } 

the problem is that everything is displayed in 1 column, I just can not understand how to display information in 3 or 4 columns

information output from the above code

Please stick your nose where I'm not doing this, I would like to see something like this enter image description here

    1 answer 1

    Tables are better not to do this. Better to make a div with style.

     float:left 
    • yes it really worked that prompted, I had to add a little and everything turned out, I wrote the table in the sense that in 1 cell, the photo was centered, in 2 cell, below, the nickname was centered, if there is another way, tell me not to show on the page I will be grateful - cy_r_ax
    • the same blocks but without float: left and with the property width: 100% - lyhoshva