<? echo '<table>';
echo '<tr>';
$i = 2;
$query=mysql_query("select * from tb_guru order by nip");
while($rs = mysql_fetch_array($query)){
echo '<td><img src="admin/images/'.$rs['namafoto'].'"/></td>';
echo '</tr>';
echo '<tr>';
echo '<td>'.$rs['nip'].'</td>';
echo '</tr>';
echo '<tr>';
echo '<td>'.$rs['namaguru'].'</td>';
echo '</tr>';
if($i % 2){
echo '<tr>';
}
$i++;
}
echo '</tr>';
echo '</table>';
?>
<?php
echo '<table>';
$i = 0;
$query=mysql_query("select * from tb_guru order by nip");
$count = mysql_num_rows($query);
while($rs = mysql_fetch_array($query)){
if($i++ % 2 == 0){
echo '<tr>';
}
echo '<td>';
echo '<img src="admin/images/'.$rs['namafoto'].'"/>';
echo '<br/>'.$rs['nip'];
echo '<br/>'.$rs['namaguru'];
echo '</td>';
if($i % 2 || $i >= $count){
echo '</tr>';
}
}
echo '</table>';