|
|
|
จะดึงข้อมูลจาก mysql มาใส่ในแต่ละแถวแต่ละ คอลั่ม ของ Bootstrap Grids ยังไงครับ |
|
|
|
|
|
|
|
Code (PHP)
<?php
foreach($data as $dt){
?>
<div class="con-md-3">
echo "Grids";
</div>
<?php
}
?>
แล้วตัว pagination ก็เหมือนแสดงข้อมูลเป็นแถวอะครับ
|
ประวัติการแก้ไข 2015-09-07 15:13:11
|
|
|
|
Date :
2015-09-07 15:12:17 |
By :
tam78910 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ผมทำ index.php ไว้แบบนี้ครับ
ไม่รู้ว่าจะต้องใส่ตรงจุดไหน มือใหม่จริงๆ พยายามลองทำไปด้วย ยังไงก็ขอบคุณนะครับที่ชี้แนะ
Code (PHP)
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<style>
body {
padding-top: 10px;
}
@media (max-width: 980px) {
body {
padding-top: 0;
}
}
</style>
<body>
<nav class="navbar navbar-default">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">
<img alt="Brand" src="...">
</a>
</div>
<form class="navbar-form navbar-right" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
<li><a href="#">Link</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
</body>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-9">
<div class="row">
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
</div>
<div class="row">
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
</div>
<div class="row">
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
</div>
<div class="row">
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
<div class="col-md-2 portfolio-item">
<a href="#">
<img class="img-responsive" src="http://placehold.it/180x180" alt="">
</a>
<h3>
<a href="#">Project Name</a>
</h3>
<p> consectetur adipiscing elit. </p>
</div>
</div>
</div>
<!--/span-->
<div class="col-sm-3">
<div class="sidebar-nav-fixed pull-right affix">
<div class="well">
<ul class="nav ">
<li class="nav-header">Sidebarfffffffffffffffffffffffffffffffffffffffffff</li>
<li class="active"><a href="#">Link</a>
</li>
<li><a href="#">Link</a>
</li>
<li><a href="#">Link</a>
</li>
<li><a href="#">Link</a>
</li>
</ul>
</div>
<!--/.well -->
</div>
<!--/sidebar-nav-fixed -->
</div>
<!--/span-->
</div>
<!--/row-->
<hr>
<!-- Pagination -->
<div class="row text-center">
<div class="col-lg-12">
<ul class="pagination">
<li>
<a href="#">«</a>
</li>
<li class="active">
<a href="#">1</a>
</li>
<li>
<a href="#">2</a>
</li>
<li>
<a href="#">3</a>
</li>
<li>
<a href="#">4</a>
</li>
<li>
<a href="#">5</a>
</li>
<li>
<a href="#">»</a>
</li>
</ul>
</div>
</div>
<!-- /.row -->
<hr>
<!-- Footer -->
<footer>
<div class="row">
<div class="col-lg-12">
<p>Copyright © Your Website 2014</p>
</div>
</div>
<!-- /.row -->
</footer>
</div>
<!-- /.container -->
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
|
|
|
|
|
Date :
2015-09-07 16:39:59 |
By :
kanapang |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|