|
|
|
รบกวนดู code echo ตาราง 4 colume ให้หน่อยคับ ตารางออก เป็น 4 colume เเต่เป็นแบบนี้คับ |
|
|
|
|
|
|
|
คิดว่า น่าจะผิดที่ tr td นะ ลองคลิดขวาแล้ว view code html ดูก่อนนะว่าใส่ tab ถูกไหม
|
|
|
|
|
Date :
2009-08-09 22:11:50 |
By :
g4764245 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
คือ ส่วนนี้อ่ะคับ
Code (PHP)
<?
include "connect.php";
include "function.php";
$perRow = 4;
echo '<table width=800 border=2>';
$sql="select * from tb_addmonth order by id_m asc";
$result=mysql_db_query($dbname,$sql);
//echo "
//<table width='80%' border='1'>
// <tr bgcolor='#D2E9FF'>
// <td width='8%'><center><b><font size='2' face='MS Sans Serif'>ID</font></b></center></td>
// <td width='61%'> <center><b><font size='2' face='MS Sans Serif'>Web Directory</font></b></center></td>
// <td width='15%'> <center><b><font size='2' face='MS Sans Serif'>Edit</font></b></center></td>
// <td width='16%'> <center><b><font size='2' face='MS Sans Serif'>Delete</font></b></center></td>
//</tr>";
while($record=mysql_fetch_array($result)) {
$id_m=$record[id_m];
$name_m=$record[name_m];
$date_m=$record[date_m];
$name_m=htmlspecialchars($name_m);
$date_m=displaydate($date_m);
$sql2 ="select count(*) as tt from tb_adddate where ref_id= $id_m";
$aaa=mysql_db_query($dbname,$sql2);
while($bbb=mysql_fetch_array($aaa)) {
$num = $bbb[tt];
}
if ( ( $id_m % $perRow ) == 0 ) echo '<tr>';
echo "<td>
<font size='2' face='MS Sans Serif'><a href='answer_view.php?id_m=$id_m'>$name_m [$num]</a></font>
<font size='2' face='MS Sans Serif'><a href='question_view.php?&id_m=$id_m'>Edit</a></font>
<font size='2' face='MS Sans Serif'><a href='question_del.php?&id_m=$id_m&id_d=$id_d'>Delete</a></font>
</td>";
if ( ( ( $id_m + 1 ) % $perRow ) == 0 ) echo '</tr>';
}
if ( ( $id_m + 1 ) % $perRow != 0 )
{
while ( $id_m % $perRow != 0 )
{
echo "<td> </td>";
$id_m++;
}
echo '</tr>';
}
echo '</table>';
?>
|
|
|
|
|
Date :
2009-08-09 22:49:11 |
By :
olme |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<?php
/*** By Weerachai Nukitram ***/
/*** http://www.ThaiCreate.Com ***/
?>
<html>
<head>
<title>ThaiCreate.Com Multiple Column</title>
</head>
<body>
<div align="center">
<?
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("mydatabase");
$strSQL = "SELECT * FROM gallery ORDER BY GalleryID ASC ";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
echo"<table border=\"0\" cellspacing=\"1\" cellpadding=\"1\"><tr>";
$intRows = 0;
while($objResult = mysql_fetch_array($objQuery))
{
$intRows++;
echo "<td>";
?>
<table width="91" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><a href="gallery/<?=$objResult["Picture"];?>" target="_blank"><img src="gallery/<?=$objResult["Thumbnails"];?>" width="70" height="53" border="0"></a></div></td>
</tr>
<tr>
<td><div align="center"><?=$objResult["GalleryName"];?></div></td>
</tr>
</table>
<?
echo"</td>";
if(($intRows)%2==0)
{
echo"</tr>";
}
else
{
echo "<td>";
}
}
echo"</tr></table>";
?>
<?
mysql_close($objConnect);
?>
</div>
</body>
</html>
|
|
|
|
|
Date :
2009-08-10 06:42:34 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้เเล้ว ขอบคุณมากมาายคับ
|
|
|
|
|
Date :
2009-08-10 19:35:39 |
By :
olme |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|