Contoh
Berikut ialah contoh program untuk mencipta baris dan lajur jadual.
<!DOCTYPE html>
<html>
<style>
table {
border:1px solid black;
padding: 10px;
}
th, td{
border:1px solid black;
padding: 20px;
}
</style>
<body>
<h2>Tables in HTML</h2>
<table style="width: 100%">
<tr>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
Contoh
Berikut ialah satu lagi contoh program untuk mencipta baris dan lajur jadual.
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid green;
}
</style>
</head>
<body>
<h2>Adding table rows and colomns in HTML</h2>
<table>
<tr>
<th>S.no</th>
<th>Name</th>
<th>Age</th>
<th>Country</th>
</tr>
<tr>
<td>1</td>
<td>Kohli</td>
<td>34</td>
<td>India</td>
</tr>
<tr>
<td>2</td>
<td>Rabada</td>
<td>29</td>
<td>South Africa</td>
</tr>
<tr>
<td>3</td>
<td>Starc</td>
<td>33</td>
<td>Australia</td>
</tr>
</table>
</body>
</html>
Contoh
Berikut ialah satu lagi contoh program untuk mencipta baris dan lajur jadual.
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid green;
}
</style>
</head>
<body>
<h2>Adding table rows and colomns in HTML</h2>
<table style="width:80%">
<caption>Cricketers...</caption>
<tr style="background-color: Mediumseagreen">
<th>S.no</th>
<th>Name</th>
<th>Age</th>
<th>Country</th>
</tr>
<tr>
<td>1</td>
<td>Kohli</td>
<td>34</td>
<td>India</td>
</tr>
<tr>
<td>2</td>
<td>Rabada</td>
<td>29</td>
<td>South Africa</td>
</tr>
<tr style="background-color: Mediumseagreen">
<td>3</td>
<td>Starc</td>
<td>33</td>
<td>Australia</td>
</tr>
</table>
</body>
</html>