card column kaya tampilan sekolah coding

Selamat siang, Mau tanya gimana caranya supaya tampilan barisan card nya kaya di sekolah coding, kalo yang saya buat malah baris ke bawah.

<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="image-flip">
<div class="card">
<div class="card-body text-center">
<h4 class="card-title"><?=$data['oc_id'] ?></h4>
<p class="card-text"><?=$data['oc_name'] ?>.</p>
</div>
<button class="btn btn-info" onclick="window.location.href='detail_laporan_perjalanan'">
<i class="fa fa-file-text-o" aria-hidden="true"></i> Laporan
</button>
</div>
</div>
</div>
</div>
</div>

card_.PNG

avatar Obbytokun
@Obbytokun

186 Kontribusi 16 Poin

Diperbarui 4 tahun yang lalu

Tanggapan

Coba kirim screenshot kodenya juga

sudah pak di atas

2 Jawaban:

<div>coba kalo kaya gini gmna ?&nbsp;</div><pre>&lt;div class="container"&gt; &lt;div class="row"&gt; &lt;div class="col-xs-12 col-sm-6 col-md-4"&gt; &lt;div class="image-flip"&gt; &lt;div class="card"&gt; &lt;div class="card-body text-center"&gt; &lt;h4 class="card-title"&gt;&lt;?=$data['oc_id'] ?&gt;&lt;/h4&gt; &lt;p class="card-text"&gt;&lt;?=$data['oc_name'] ?&gt;.&lt;/p&gt; &lt;/div&gt; &lt;button class="btn btn-info" onclick="window.location.href='detail_laporan_perjalanan'"&gt; &lt;i class="fa fa-file-text-o" aria-hidden="true"&gt;&lt;/i&gt; Laporan &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="col-xs-12 col-sm-6 col-md-4"&gt; &lt;div class="image-flip"&gt; &lt;div class="card"&gt; &lt;div class="card-body text-center"&gt; &lt;h4 class="card-title"&gt;&lt;?=$data['oc_id'] ?&gt;&lt;/h4&gt; &lt;p class="card-text"&gt;&lt;?=$data['oc_name'] ?&gt;.&lt;/p&gt; &lt;/div&gt; &lt;button class="btn btn-info" onclick="window.location.href='detail_laporan_perjalanan'"&gt; &lt;i class="fa fa-file-text-o" aria-hidden="true"&gt;&lt;/i&gt; Laporan &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="col-xs-12 col-sm-6 col-md-4"&gt; &lt;div class="image-flip"&gt; &lt;div class="card"&gt; &lt;div class="card-body text-center"&gt; &lt;h4 class="card-title"&gt;&lt;?=$data['oc_id'] ?&gt;&lt;/h4&gt; &lt;p class="card-text"&gt;&lt;?=$data['oc_name'] ?&gt;.&lt;/p&gt; &lt;/div&gt; &lt;button class="btn btn-info" onclick="window.location.href='detail_laporan_perjalanan'"&gt; &lt;i class="fa fa-file-text-o" aria-hidden="true"&gt;&lt;/i&gt; Laporan &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;</pre>

avatar ahanafi
@ahanafi

815 Kontribusi 554 Poin

Dipost 4 tahun yang lalu

Tanggapan

kalo gitu hasil nya, 3 baris data nya sama gan.

iya tinggal di looping aja pake while,

<pre>&lt;?php while($data = mssql_fetch_array($result)){ ?&gt; &lt;div class="container"&gt; &lt;div class="row"&gt; &lt;div class="col-xs-12 col-sm-6 col-md-4"&gt; &lt;div class="image-flip"&gt; &lt;div class="card"&gt; &lt;div class="card-body text-center"&gt; &lt;h4 class="card-title"&gt;&lt;?=$data['oc_id'] ?&gt;&lt;/h4&gt; &lt;p class="card-text"&gt;&lt;?=$data['oc_name'] ?&gt;.&lt;/p&gt; &lt;/div&gt; &lt;button class="btn btn-info" onclick="window.location.href='detail_laporan_perjalanan'"&gt; &lt;i class="fa fa-file-text-o" aria-hidden="true"&gt;&lt;/i&gt; Laporan &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="col-xs-12 col-sm-6 col-md-4"&gt; &lt;div class="image-flip"&gt; &lt;div class="card"&gt; &lt;div class="card-body text-center"&gt; &lt;h4 class="card-title"&gt;&lt;?=$data['oc_id'] ?&gt;&lt;/h4&gt; &lt;p class="card-text"&gt;&lt;?=$data['oc_name'] ?&gt;.&lt;/p&gt; &lt;/div&gt; &lt;button class="btn btn-info" onclick="window.location.href='detail_laporan_perjalanan'"&gt; &lt;i class="fa fa-file-text-o" aria-hidden="true"&gt;&lt;/i&gt; Laporan &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;

&lt;/div&gt; &lt;/div&gt;

&lt;?php } ?&gt;</pre>

avatar Obbytokun
@Obbytokun

186 Kontribusi 16 Poin

Dipost 4 tahun yang lalu

Login untuk ikut Jawaban