Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,028

HOME > PHP > PHP Forum > ต้องการทำช่องตารางให้เท่าๆกันทำไงค่ะ ตามโค้ดที่เราทำน่ะ ทำออกมาแล้วมันไม่ตรงกันอ่ะมันเหลื่อมๆ กันอยุ่อ่ะ ช่วยๆหน่อยน่ะ ขอบคุนล่วงหน้าค่ะ



 

ต้องการทำช่องตารางให้เท่าๆกันทำไงค่ะ ตามโค้ดที่เราทำน่ะ ทำออกมาแล้วมันไม่ตรงกันอ่ะมันเหลื่อมๆ กันอยุ่อ่ะ ช่วยๆหน่อยน่ะ ขอบคุนล่วงหน้าค่ะ

 



Topic : 022511

Guest




ตามโค้ดที่เราทำน่ะ

<table width="220%" border="1" align="center">
<!-- <table border="1" align="center"> -->
<tr>
<td width="10%">
<div align="center">No.</div>
</td>
<td width="10%">
<div align="center">Servernames</div>
</td>
<td width="10%">
<div align="center">Model&nbsp</div>
</td>
<td width="10%">
<div align="center">OS</div>
</td>
<td width="10%">
<div align="center">Applications</div>
</td>
<td width="10%">
<div align="center">Functions</div>
</td>
<td width="10%">
<div align="center">CPU</div>
</td>
<td width="10%">
<div align="center">I.HDD</div>
</td>
<td width="10%">
<div align="center">E.HDD</div>
</td>
<td width="10%">
<div align="center">CPU_Num</div>
</td>
<td width="10%">
<div align="center">HDD_Num</div>
</td>
<td width="10%">
<div align="center">Partition_GB</div>
</td>
<td width="10%">
<div align="center">RaidDisk</div>
</td>
<td width="10%">
<div align="center">IPAddress</div>
</td>
<td width="10%">
<div align="center">Type</div>
</td>
<td width="10%">
<div align="center">Serial_No</div>
</td>
<td width="10%">
<div align="center">Warranty</div>
</td>
<td width="10%">
<div align="center">MA_Type</div>
</td>
<td width="10%">
<div align="center">Purchase_Date</div>
</td>
<td width="10%">
<div align="center">Warranty_Exp</div>
</td>
<td width="10%">
<div align="center">Location</div>
</td>
<td width="10%">
<div align="center">Remark</div>
</td>
</tr>
</table>
<?

$a=0;
while($a < $num_rows)
{
$result = mysql_fetch_array($db_query);
$num=$result[Number];
$servername=$result[Servername];
$model=$result[Model];
$os=$result[Os];
$applications=$result[Application];
$functions=$result[Function_S];
$cpu=$result[Cpu];
$memorymb=$result[Memory_MB];
$ihdd=$result[I_HDD];
$ehdd=$result[E_HDD];
$cpunum=$result[Cpu_NUM];
$hddnum=$result[HDD_NUM];
$partitiongb=$result[Partition_GB];
$ipaddress=$result[IPaddress];
$type=$result[Type];
$serialno=$result[Serial_NO];
$warranty=$result[Warranty];
$matype=$result[MA_TYPE];
$purchasedate=$result[Purchase_DATE];
$warrantyexp=$result[Warranty_EXP];
$location=$result[Location];
$remark=$result[Remark];
?>
<table width="220%" border="1" align="center">
<!-- <table border="1" align="center"> -->
<tr>
<td >
<div align="center"width="20%">
<?echo"$num";?></div>
</td>
<td width="10%">
<?echo"$servername";?>
</td>
<td width="10%">
<?echo"$model";?>
</td>
<td width="10%">
<?echo"$os";?>
</td>
<td width="10%">
<?echo"$applications";?>
</td>
<td width="10%">
<?echo"$functions";?>
</td>
<td width="10%">
<?echo"$cpu";?>
</td>
<td width="10%">
<?echo"$memorymb";?>
</td>
<td width="10%">
<?echo"$ihdd";?>
</td>
<td width="10%">
<?echo"$ehdd";?>
</td>
<td width="10%">
<?echo"$cpunum";?>
</td>
<td width="10%">
<?echo"$hddnum";?>
</td>
<td width="10%">
<?echo"$partitiongb";?>
</td>
<td width="10%">
<?echo"$raiddisk";?>
</td>
<td width="10%">
<?echo"$ipaddress";?>
</td>
<td width="10%">
<?echo"$type";?>
</td>
<td width="10%">
<?echo"$serialno";?>
</td>
<td width="10%">
<?echo"$warranty";?>
</td>
<td width="10%">
<?echo"$matype";?>
</td>
<td width="10%">
<?echo"$purchasedate";?>
</td>
<td width="10%">
<?echo"$warrantyexp";?>
</td>
<td width="10%">
<?echo"$location";?>
</td>
<td width="10%">
<?echo"$remark";?>
</td>

</tr>
</table>
</body>
</html>

ทำออกมาแล้วมันไม่ตรงกันอ่ะมันเหลื่อมๆ

กันอยุ่อ่ะ

ช่วยๆหน่อยน่ะ

ขอบคุนล่วงหน้าค่ะ


Tag : - - - -







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 9 ต.ค. 2551 14:23:13 By : ่แว๊วว View : 2741 Reply : 6
 

 

No. 1

Guest


ลองทำใน Dream ดูดิ






Date : 9 ต.ค. 2551 15:17:21 By : array
 


 

No. 2

Guest


ลองทำใน ดรีมแล้ว

มานงงๆอ่ะ

ช่วยดูให้หน่อยนะ
Date : 9 ต.ค. 2551 15:32:37 By : แว๊ววว
 

 

No. 3

Guest


ก็ไม่ต้องแยก table ซิครับ จะได้ตรงกัน

<table width="220%" border="1" align="center">
<!-- <table border="1" align="center"> -->
<tr>
<td width="10%">
<div align="center">No.</div>
</td>
<td width="10%">
<div align="center">Servernames</div>
</td>
<td width="10%">
<div align="center">Model&nbsp</div>
</td>
<td width="10%">
<div align="center">OS</div>
</td>
<td width="10%">
<div align="center">Applications</div>
</td>
<td width="10%">
<div align="center">Functions</div>
</td>
<td width="10%">
<div align="center">CPU</div>
</td>
<td width="10%">
<div align="center">I.HDD</div>
</td>
<td width="10%">
<div align="center">E.HDD</div>
</td>
<td width="10%">
<div align="center">CPU_Num</div>
</td>
<td width="10%">
<div align="center">HDD_Num</div>
</td>
<td width="10%">
<div align="center">Partition_GB</div>
</td>
<td width="10%">
<div align="center">RaidDisk</div>
</td>
<td width="10%">
<div align="center">IPAddress</div>
</td>
<td width="10%">
<div align="center">Type</div>
</td>
<td width="10%">
<div align="center">Serial_No</div>
</td>
<td width="10%">
<div align="center">Warranty</div>
</td>
<td width="10%">
<div align="center">MA_Type</div>
</td>
<td width="10%">
<div align="center">Purchase_Date</div>
</td>
<td width="10%">
<div align="center">Warranty_Exp</div>
</td>
<td width="10%">
<div align="center">Location</div>
</td>
<td width="10%">
<div align="center">Remark</div>
</td>
</tr>

<?

$a=0;
while($a < $num_rows)
{
$result = mysql_fetch_array($db_query);
$num=$result[Number];
$servername=$result[Servername];
$model=$result[Model];
$os=$result[Os];
$applications=$result[Application];
$functions=$result[Function_S];
$cpu=$result[Cpu];
$memorymb=$result[Memory_MB];
$ihdd=$result[I_HDD];
$ehdd=$result[E_HDD];
$cpunum=$result[Cpu_NUM];
$hddnum=$result[HDD_NUM];
$partitiongb=$result[Partition_GB];
$ipaddress=$result[IPaddress];
$type=$result[Type];
$serialno=$result[Serial_NO];
$warranty=$result[Warranty];
$matype=$result[MA_TYPE];
$purchasedate=$result[Purchase_DATE];
$warrantyexp=$result[Warranty_EXP];
$location=$result[Location];
$remark=$result[Remark];
?>

<!-- <table border="1" align="center"> -->
<tr>
<td >
<div align="center"width="20%">
<?echo"$num";?></div>
</td>
<td width="10%">
<?echo"$servername";?>
</td>
<td width="10%">
<?echo"$model";?>
</td>
<td width="10%">
<?echo"$os";?>
</td>
<td width="10%">
<?echo"$applications";?>
</td>
<td width="10%">
<?echo"$functions";?>
</td>
<td width="10%">
<?echo"$cpu";?>
</td>
<td width="10%">
<?echo"$memorymb";?>
</td>
<td width="10%">
<?echo"$ihdd";?>
</td>
<td width="10%">
<?echo"$ehdd";?>
</td>
<td width="10%">
<?echo"$cpunum";?>
</td>
<td width="10%">
<?echo"$hddnum";?>
</td>
<td width="10%">
<?echo"$partitiongb";?>
</td>
<td width="10%">
<?echo"$raiddisk";?>
</td>
<td width="10%">
<?echo"$ipaddress";?>
</td>
<td width="10%">
<?echo"$type";?>
</td>
<td width="10%">
<?echo"$serialno";?>
</td>
<td width="10%">
<?echo"$warranty";?>
</td>
<td width="10%">
<?echo"$matype";?>
</td>
<td width="10%">
<?echo"$purchasedate";?>
</td>
<td width="10%">
<?echo"$warrantyexp";?>
</td>
<td width="10%">
<?echo"$location";?>
</td>
<td width="10%">
<?echo"$remark";?>
</td>

</tr>
</table>


Date : 9 ต.ค. 2551 22:04:34 By : terngjar
 


 

No. 4

Guest


ลองใช้โค้จากรีมแล้วค่ะ แบบใช้แค่ table เดียว

ก็ทำได้นะค่ะ แต่ถ้าเรามีข้อมูลในฐานข้อมูลแค่ 1 record มันก็เพิ่มได้น่ะค่ะ

ตารางเท่ากันด้วย
แต่พอ เพิ่มข้อมูลไปอีก 1 record ข้อมูลที่เพิ่มใหม่มันก้อไม่เข้าไปอยุ่ในตารางอ่ะค่ะ

มันอยุ่ด้านล่างตารางค่ะ



<html>
<body>

<p>&nbsp;</p>
<h2 align="center">: : Show Data : :</h2>
<h3><a href="mainpage.php"><< MainPage </a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="add1.html">ADD</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EDIT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DELETE</h3>


<!-- --><!-- --><!-- -->
<?
$host="localhost";
$username="root";
$password="msc";
$db="msc server accessment";
$tb="msc";
mysql_connect( $host,$username,$password)or die ("&#181;&#212;&#180;&#181;&#232;&#205;&#161;&#209;&#186;&#176;&#210;&#185;&#162;&#233;&#205;&#193;&#217;&#197; Mysql &#228;&#193;&#232;&#228;&#180;&#233; ");
mysql_select_db($db) or die("&#224;&#197;&#215;&#205;&#161;&#176;&#210;&#185;&#162;&#233;&#205;&#193;&#217;&#197;&#228;&#193;&#232;&#228;&#180;&#233;"); /* &#183;&#211;&#161;&#210;&#195;&#224;&#197;&#215;&#205;&#161;&#176;&#210;&#185;&#162;&#233;&#205;&#193;&#217;&#197;&#161;&#232;&#205;&#185; */
$sql="Select * From $tb";
$db_query=mysql_db_query($db,$sql);
$num_rows=mysql_num_rows($db_query);
?>

<table width="2603" height="56" border="1" cellpadding="3">
<tr>
<th width="107" height="51" scope="col">No.</th>
<th width="113" scope="col">Servernames</th>
<th width="142" scope="col">Model</th>
<th width="121" scope="col">OS</th>
<th width="123" scope="col">Applications</th>
<th width="121" scope="col">Functions</th>
<th width="129" scope="col">CPU</th>
<th width="129" scope="col">Memory_MB</th>
<th width="116" scope="col">I.HDD</th>
<th width="133" scope="col">E.HDD</th>
<th width="124" scope="col">CPU_Num</th>
<th width="120" scope="col">HDD_Num</th>
<th width="115" scope="col">Partition_GB</th>
<th width="114" scope="col">RaidDisk</th>
<th width="110" scope="col">IPAddress</th>
<th width="106" scope="col">Type</th>
<th width="87" scope="col">Serial_No</th>
<th width="93" scope="col">Warranty</th>
<th width="104" scope="col">MA_Type</th>
<th width="75" scope="col">Purchase_Date</th>
<th width="90" scope="col">Warranty_Exp</th>
<th width="146" scope="col">Location</th>
<th width="146" scope="col">Remark</th>
</tr>
<tr></tr> <tr></tr> <tr></tr> <tr></tr>
<!-- </table>
</tr> -->

<?

$a=0;
while($a < $num_rows)
{
$result = mysql_fetch_array($db_query);
$num=$result[Number];
$servername=$result[Servername];
$model=$result[Model];
$os=$result[Os];
$applications=$result[Application];
$functions=$result[Function_S];
$cpu=$result[Cpu];
$memorymb=$result[Memory_MB];
$ihdd=$result[I_HDD];
$ehdd=$result[E_HDD];
$cpunum=$result[Cpu_NUM];
$hddnum=$result[HDD_NUM];
$partitiongb=$result[Partition_GB];
$raiddisk =$result[Raiddisk];
$ipaddress=$result[IPaddress];
$type=$result[Type];
$serialno=$result[Serial_NO];
$warranty=$result[Warranty];
$matype=$result[MA_TYPE];
$purchasedate=$result[Purchase_DATE];
$warrantyexp=$result[Warranty_EXP];
$location=$result[Location];
$remark=$result[Remark];
?>
<tr>
<th width="107" height="51" ><?echo"$num";?></th>
<th width="113">&nbsp;<?echo"$servername";?></th>
<th width="142" >&nbsp;<?echo"$model";?></th>
<th width="121" >&nbsp;<?echo"$os";?></th>
<th width="123" >&nbsp;<?echo"$applications";?></th>
<th width="121" >&nbsp;<?echo"$functions";?></th>
<th width="129" >&nbsp;<?echo"$cpu";?></th>
<th width="116" >&nbsp;<?echo"$memorymb";?></th>
<th width="133" >&nbsp;<?echo"$ihdd";?></th>
<th width="124" >&nbsp;<?echo"$ehdd";?></th>
<th width="120" >&nbsp;<?echo"$cpunum";?></th>
<th width="115" >&nbsp;<?echo"$hddnum";?></th>
<th width="114" >&nbsp;<?echo"$partitiongb";?></th>
<th width="110" >&nbsp;<?echo"$raiddisk";?></th>
<th width="106" >&nbsp;<?echo"$ipaddress";?></th>
<th width="87" >&nbsp;<?echo"$type";?></th>
<th width="93" scope="col">&nbsp;<?echo"$serialno";?></th>
<th width="104" scope="col">&nbsp;<?echo"$warranty";?></th>
<th width="75" scope="col">&nbsp;<?echo"$matype";?></th>
<th width="90" scope="col">&nbsp;<?echo"$purchasedate";?></th>
<th width="146" scope="col">&nbsp;<?echo"$warrantyexp";?></th>
<th width="146" scope="col">&nbsp;<?echo"$location";?></th>
<th width="146" scope="col">&nbsp;<?echo"$remark";?></th>
</tr>
<tr></tr> <tr></tr> <tr></tr>
</table>
</body>
</html>
<?php
$a++;
}
echo "<center><br> Reccord = $num_rows</center>";
mysql_close();
?>


Date : 10 ต.ค. 2551 10:47:03 By : ่แว๊วว
 


 

No. 5

Guest


ลองเอา </table></body></html> มาไว้ด้านนอก while loop สิครับ
Date : 10 ต.ค. 2551 16:12:34 By : frintstone
 


 

No. 6

Guest


อ่อ

ทำได้แล้วค่ะ

ขอบคุนน่ะค่ะ
Date : 13 ต.ค. 2551 08:50:31 By : แว๊วว
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ต้องการทำช่องตารางให้เท่าๆกันทำไงค่ะ ตามโค้ดที่เราทำน่ะ ทำออกมาแล้วมันไม่ตรงกันอ่ะมันเหลื่อมๆ กันอยุ่อ่ะ ช่วยๆหน่อยน่ะ ขอบคุนล่วงหน้าค่ะ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่