Menampilkan Data Multi Kolom Horisontal 2

Intro:The first and most obvious difference between the two tablets is their size. The BlackBerry PlayBook is a 7 inch device with dimensions of 193 x 130 x 10mm and a weight of 400g, while the iPad 2 is a 10.1 inch tablet with dimensions of 241 x 186 x 9mm, with the top-spec 3G model weighing a heavier 610g.

Apple have always had a strong eye for design and the iPad 2 is arguably their crowning hour - it's incredibly sleek, looking especially "sci-fi" with its new white bezel. Whereas the iPad 2 has a physical home button on the bottom of its bezel, the BlackBerry PlayBook has no buttons on its front side, making for a very slick and smooth front face, even if the black boxy design of RIM's unit is a little uninspired overall. The tiny power button on the PlayBook is a chore to find though.


Trik ini aalah unutk menampilkan data dengan pengurutan
<?php
$kolom = 3; // Tentukan banyaknya kolom
$no = 1; // Untuk penomoran

mysql_connect("localhost","root","");
mysql_select_db("dbphp");

$sql = mysql_query("SELECT nama FROM anggota");
$jml_baris = mysql_num_rows($sql);

echo "<table>";
for($i = 0; $i < $jml_baris; $i++) {
$data = mysql_fetch_array($sql);

// % adalah operator modulus (sisa bagi)
if($i % $kolom == 0) {
echo "<tr bgcolor=cccccc>";
}
echo "<td>$no</td>";
echo "<td>$data[nama]</td>";

if(($i % $kolom) == ($kolom - 1) OR ($i + 1) == $jml_baris) {
echo "</tr> ";
}
$no++;
}
echo "</table> ";
?>

Hasilnya: