select 3 kolom

Robert James M · Oct 24, 2012
mas aku mau tanya, bagaimana cara membuat hasil select itu pas muncul menjadi 3 kolom dan bukan terus kebawah, ini script yang sudah aku buat, terima kasih
<!DOCTYPE html>
<html lang="en">
<head>
  	<title>select 3 kolom</title>
  	<meta charset="utf-8">
    <meta name="description" content="Your description">
    <meta name="keywords" content="Your keywords">
    <meta name="author" content="Your name">
    <link rel="stylesheet" href="css/style.css">
    <script src="js/jquery-1.7.1.min.js"></script>
    <script src="js/superfish.js"></script>
    <script src="js/jquery.easing.1.3.js"></script>
    <script src="js/tms-0.4.1.js"></script>
    <script src="js/slider.js"></script>
<!--[if lt IE 8]>
   <div style=' clear: both; text-align:center; position: relative;'>
     <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode">
       <img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." />
    </a>
  </div>
<![endif]-->
<!--[if lt IE 9]>
	<script src="js/html5.js"></script>
	<link rel="stylesheet" href="css/ie.css"> 
<![endif]-->
</head>
<body>
<div class="main-indents">
    <div class="main">
        <!-- Header -->
        <header>
            <h1 class="logo">&nbsp;</h1>
            <nav>
                <ul class="sf-menu">
                    <li class="current"><a href="index.php">Home</a></li>
                    <li><a href="login.php">Login</a></li>
                    <li><a href="form_user.php">Daftar</a></li>
					<li><a href="form_iklan.php">Iklan</a></li>
                    <li><a href="search.php">Search</a></li>
                </ul>
            </nav>
            <div class="clear"></div>
        </header>
        <!-- Slider -->
        <div class="">
            <ul class="items">
                <li>
                  <img src="images/slide-3.jpg" alt="" width="960" />
            </ul>
      </div>
        <!-- Content -->
        <section id="content"><div class="ic"></div>
            <div class="container_12">
           	  <article class="a1"></article>
                <article class="content-box">
                	<h3 class="hp-1">Iklan</h3>
					
<?php

  mysql_connect   ("localhost", "root", "");
  mysql_select_db ("");
  
   if(isset($txtcari))
	{
	   $myquery="select Tipe, Nama_produk, Nama_user, Email, Tlp, Harga from iklan where Id_iklan='$txtcari' or Tipe LIKE '%$txtcari%'";
	}
	else
	{
	   $myquery="select Id_iklan, Tipe, Nama_produk, Nama_user, Email, Tlp, Harga from iklan";
	}
		$daftarsiswa=mysql_query($myquery) or die (mysql_error());
		
	while($hasil=mysql_fetch_object($daftarsiswa))
	{

              ?>
  
  
  
 

                    <div class="wrapper">
                    	<div class="col-1">
                        	<figure class="img-box"></figure>
                            <h5><span>Jenis Iklan :</span> <?php echo $hasil->Tipe;?></h5>
                            <p>	
								<span>Id iklan 	:</span><?php echo $hasil->Id_iklan;?><br>
                            	<span>Produk 	:</span><?php echo $hasil->Nama_produk;?><br>
								<span>Oleh 		:</span><?php echo $hasil->Nama_user;?><br>
								<span>Email		:</span><?php echo $hasil->Email;?><br>
								<span>Tlp 		:</span><?php echo $hasil->Tlp;?><br>
								<span>Harga 	:</span><?php echo $hasil->Harga;?>
                            </p>
                        </div>						
                    </div>
					<?
	}
?>
                </article>
            </div>
        </section>
        <!-- Footer -->
        <footer>
            
		<ul class="social-list">
            	<li><a href="#"><img src="images/soc-icon-1.png" alt=""></a></li>
                <li><a href="#"><img src="images/soc-icon-2.png" alt=""></a></li>
                <li><a href="#"><img src="images/soc-icon-3.png" alt=""></a></li>
            </ul>
        </footer>
    </div>
</div>
</body>
</html>
Silahkan login untuk menjawab!
0
Loading...
Ellyx Christian · Oct 25, 2012 · 0 Suka · 0 Tidak Suka
<?php
 
  mysql_connect   ("localhost", "root", "");
  mysql_select_db ("");
 
   if(isset($txtcari))
	{
	   $myquery="select Tipe, Nama_produk, Nama_user, Email, Tlp, Harga from iklan where Id_iklan='$txtcari' or Tipe LIKE '%$txtcari%'";
	}
	else
	{
	   $myquery="select Id_iklan, Tipe, Nama_produk, Nama_user, Email, Tlp, Harga from iklan";
	}
		$daftarsiswa=mysql_query($myquery) or die (mysql_error());
 $i = 1;
	while($hasil=mysql_fetch_object($daftarsiswa))
	{
 
              ?>
 
 
 
 
 
                    <div class="wrapper" style="width:32%; margin-right:1%;float:left">
                    	<div class="col-1">
                        	<figure class="img-box"></figure>
                            <h5><span>Jenis Iklan :</span> <?php echo $hasil->Tipe;?></h5>
                            <p>	
								<span>Id iklan 	:</span><?php echo $hasil->Id_iklan;?><br>
                            	<span>Produk 	:</span><?php echo $hasil->Nama_produk;?><br>
								<span>Oleh 		:</span><?php echo $hasil->Nama_user;?><br>
								<span>Email		:</span><?php echo $hasil->Email;?><br>
								<span>Tlp 		:</span><?php echo $hasil->Tlp;?><br>
								<span>Harga 	:</span><?php echo $hasil->Harga;?>
                            </p>
                        </div>						
                    </div>
<?
	if($i % 3 == 0){
		echo '<div style="clear:both"></div>';
	}
	$i++;
	}
?>
<div style="clear:both"></div>