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

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

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

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

โดย moomai » 08/03/2017 3:53 pm

ต้องการให้บรรทัดตารางแสดงข้อมูลคนละสีกันโดยใช้ 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 483 times

ข้างบน