|
|
|
อยากจะให้ แถวแนวนอน ครบ 4แล้วขึ้น บรรทัดใหม่ ต้องเพิ่มโค๊ดยังไง? |
|
|
|
|
|
|
|
DEV เอาเอง
Code (PHP)
<?php
$i=0;
$arr=array('a','b','c','d','e','f','g');
echo "<table border='1'><tr>";
while($i<count($arr))
{
if(($i%2)==0) // %mod หาเศษ
{
echo "<tr><td>".$arr[$i];
}else{
echo "<td>".$arr[$i];
}
$i++;
}
echo "<table>";
?>
|
|
|
|
|
Date :
2020-01-16 12:43:35 |
By :
Genesis™ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (XML)
<style>
.detail{ float: left; width: calc(100% / 3);}
</style>
<div id="parent">
<div class="detail">abc</div>
<div class="detail">abc</div>
<div class="detail">abc</div>
<div class="detail">abc</div>
<div class="detail">abc</div>
<div class="detail">abc</div>
<div class="detail">abc</div>
<div class="detail">abc</div>
<div class="detail">abc</div>
</div>
bootstarp
Code (XML)
<div id="parent" class"row">
<div class="col-4">abc</div>
<div class="col-4">abc</div>
<div class="col-4">abc</div>
<div class="col-4">abc</div>
<div class="col-4">abc</div>
<div class="col-4">abc</div>
<div class="col-4">abc</div>
<div class="col-4">abc</div>
<div class="col-4">abc</div>
</div>
|
|
|
|
|
Date :
2020-01-17 07:08:35 |
By :
Chaidhanan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|