อยากตัด Table แนวนอน ใช้คำสั่งอะไรค่ะ
ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา อยากตัด Table แนวนอน ใช้คำสั่งอะไรค่ะ
อยากตัด Table แนวนอน ใช้คำสั่งอะไรค่ะ
Copy
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>โปรแกรมแสดงสูตรคูณ</title>
<style>
input[type=text] {
width: 20%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
border: 1px solid red;
border-radius: 4px;
}
</style>
<style>
.button {
background-color: #4CAF50; /* Green */
border: none;
color: white;
padding: 8px 10px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 2px 5px;
cursor: pointer;
}
.button1 {width: 100px;}
.button2 {width: 100%;}
.button3 {
padding-left: 0;
padding-right: 0;
width: 100%;
}
</style>
<style>
li{display:inline;}
</style>
<style>
table {
border-collapse: collapse;
margin-right: auto;
}
table, td, th {
border: 1px solid black;
height: 10px;
vertical-align:bottom;
}
</style>
</head>
<body>
<table align="center">
<tr>
<td>
<center>ป้อนตัวเลขแม่สูตรคูณแสดงผลลัพธ์</center>
<form name="form1" method="post" action="">
<center>
<b>สูตรคูณแม่ที่ : </b> <input type="text" name="num_start" size="5">
<b>ถึง :</b><input type="text" name="num_end" size="5">
<input class="button button1"type="submit" value="คำนวณ">
</center>
</form>
</td>
</tr>
</table>
<br>
<?php
$num_start = $_POST['num_start'];
$num_end = $_POST['num_end'];
if(($num_start != "") AND ($num_end != ""))
for($i=$num_start;$i<=$num_end;$i++){
echo "<center>";
//echo "สูตรคูณ แม่ 1 ถึง 12 <p>";
//for($i = 1;$i<=12;$i++){
echo"<ul>";
echo"<li>";
echo "
<table border='1' style='display:table-cell'>
<tr>
<th>แม่ $i</th>
</tr>";
for($a=1;$a<=12;$a++){
echo "
<tr>
<td>$i X $a = <font color='red'>".$i*$a." </font></td>
</tr>";
}
echo "</table>";
echo"<p>";
//}
echo "</center>";
}
?>
</body>
</html>
คำแนะนำ และการใช้งาน
สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก
- ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
เว็บไซต์ของเราให้บริการเนื้อหาบทความสำหรับนักพัฒนา โดยพึ่งพารายได้เล็กน้อยจากการแสดงโฆษณา
โปรดสนับสนุนเว็บไซต์ของเราด้วยการปิดการใช้งานตัวปิดกั้นโฆษณา (Disable Ads Blocker) ขอบคุณครับ