ต้องการให้บรรทัดตารางแสดงข้อมูลคนละสีกันโดยใช้ bootstrap ต้องทำยังไงค่ะ

สำหรับผู้ที่ เริ่มต้น Programming - PHP มีอะไร แนะนำ หรือข้อสงสัยต้องบอร์ด นี้ คนที่มีความรู้ แบ่งปันคนอื่นบ้างนะ ปัญหาการเขียนโปรแกรม แบบ OOP Session Cookies php network

Moderator: mindphp, ผู้ดูแลกระดาน

moomai
PHP Super Hero Member
PHP Super Hero Member
โพสต์: 680
ลงทะเบียนเมื่อ: 07/12/2016 10:54 am

ต้องการให้บรรทัดตารางแสดงข้อมูลคนละสีกันโดยใช้ bootstrap ต้องทำยังไงค่ะ

โพสต์ที่ยังไม่ได้อ่าน โดย moomai »

ต้องการให้บรรทัดตารางแสดงข้อมูลคนละสีกันโดยใช้ bootstrap ต้องทำยังไงค่ะ
คือนำ class="table table-striped" ของ bootstrap มาใช้แล้ว แต่ตอนแสดงข้อมูลมันไม่สับสีกัน เป็นเพราะอะไรคะ ต้องแก้ยังไง

โค้ดที่ทำ

โค้ด: เลือกทั้งหมด

<table id="table-listtax" class="table table-striped" >
				<thead>
					<tr>
						<th bgcolor="#8c8cd9"><p align="center">ลำดับ</p></th>
						<th bgcolor="#8c8cd9"><p align="center">ชื่อผู้ใช้งาน</p></th>
						<th bgcolor="#8c8cd9"><p align="right">จำนวนเงิน</p></th>
						<th bgcolor="#8c8cd9"><p align="center">ภาษี %</p></th>
						<th bgcolor="#8c8cd9"><p align="right">เงินภาษี </p></th>
						<th bgcolor="#8c8cd9"><p align="right">จำนวนเงินหลังหักภาษี</p></th>
						<th bgcolor="#8c8cd9"><p align="center">เวลาเข้าใช้งาน</p></th>
						<th bgcolor="#8c8cd9"><p align="center">หมายเลข<br>IP_Address</p></th>		
						<th bgcolor="#8c8cd9"><p align="center">แสดงข้อมูล</p></th>		
					</tr>
				</thead>

				<?php 
					while ($fetch = mysql_fetch_assoc($result)) {
				?>
				<tbody>
					<tr>
						<td align="center"><?php echo $fetch['id']; ?></td>
						<td align="center"><?php echo $fetch['name']; ?></td>
						<td align="right"><?php echo number_format($fetch['price'],2); ?></td>
						<td align="center"><?php echo $fetch['tax']; ?></td>
						<td align="right"><?php echo number_format($fetch['vat'],2); ?></td>
						<td align="right"><?php echo number_format($fetch['money'],2); ?></td>
						<td align="center"><?php 
							date_default_timezone_set("Asia/Bangkok");
							echo (date(" Y-m-d / H:i:s  ",$fetch['time'])); ?></td>
						<td align="center"><?php echo $fetch['ip']; ?></td>		
						<td align="center">
							<a href="showtax.php?id=<?php echo $fetch['id']; ?>"><button type="button" class="btn btn-primary">
								<i class="glyphicon glyphicon-new-window"></i></button></a>
						</td>
				</tr>
				</tbody>
		
				<?php 
					} 
				?>
			</table>
ผลที่ได้ค่ะ
Capture.PNG
Capture.PNG (3.75 KiB) Viewed 482 times
The truth is not as elegant as the idea.
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: Google Adsense [Bot] และบุคลทั่วไป 76