gran Torino
"You can keep the Gran Torino, on the condition you don't chop-top the roof like one of those beaners, don't paint any idiotic flames on it like some white trash hillbilly, and don't put a gay spoiler on the rear end like you see on all of the other zipperheads' cars, it just looks like hell." -- Walt Kowalski

Membagi dua hasil data tanpa pakai tabel murni memakai css

Posted: March 11th, 2009 | Author: | Filed under: CSS, PHP | 1 Comment »

Contoh yang berikut ini akan menghasilkan dua bagian data tanpa menggunakan tabel, yang di gunakan disini adalah CSS, DIV, UL tanpa menggunakan operator modulo (%). yang ini dapet waktu ngulik template blogscript wordpress.

Dimulai dengan CSS yang akan menentukan tampilan data sehingga terbagi menjadi 2 bagian

<style>
.clear{ clear: both; }
.content_wrap
{
padding: 0 3px;width: 360px;font-family: sans-serif;
}

#categories_menu
{
font-weight: bold;
}

#categories_menu ul
{
float: left;
margin: 0;
padding: 0;
list-style: none;
}

#categories_menu li
{
border-bottom: 1px solid #d8eded;
float: left;
margin: 0;
padding: 7px 2px 7px 5px;
width: 170px;
}

#categories_menu a:link, #categories_menu a:visited
{
color: #0084d4;font-size:8pt;
text-decoration: none;
}

#categories_menu a:hover
{
font-size:8pt;
color: #ff0099;
text-decoration: none;
}
</style>

Sebagai contoh digunakan string dibawah ini, variabel str tentunya dapat diganti dengan hasil query dari database
dimulai dengan proses pemisahan string

<?
$str = ‘Villa, Teresa,US$120,Villa,Teresa,Bali,situated,beach,Canggu,Village,stunning,landscape’;

$expThree=explode(‘,’,$str);

$n = count( $expThree );
$m = 0;
?>

mulai menuliskan hasil explode ke dalam unorderlist <li>

<div class=”content_wrap”>
<div id=”categories_menu”>
<ul>
<? for ($m=0; $m < $n; $m++)
{ ?><li><a href=”#”><?php echo $expThree[$m];?></a></li><? } ?>
</ul>
<div class=”clear”></div>
</div>
</div>


One Comment on “Membagi dua hasil data tanpa pakai tabel murni memakai css”

  1. 1 Mr WordPress said at 8:51 pm on March 11th, 2009:

    Hi, this is a comment.
    To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.


Leave a Reply