5C. Guide 4 SMT 1
5C. Guide 4 SMT 1
LEARNING OBJECTIVES :
Students are able to understand table elements in HTML.
Students are able to practice using the <table> tag in HTML
TABLE IN HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title> Get to know HTML Tables </title>
</head>
<body>
<table border="1">
<tr>
<th rowspan="2">Name</th>
<th colspan="3">Score</th>
</tr>
<tr>
<th> Chemistry </th>
<th> Physics </th>
<th> Biology </th>
</tr>
<tr>
<td>Robby</td>
<td>76</td>
<td>80</td>
<td>81</td>
</tr>
<tr>
<td>Rendy</td>
<td>84</td>
<td>70</td>
<td>75</td>
</tr>
<tr>
<td>Alfian</td>
<td>96</td>
<td>70</td>
<td>71</td>
</tr>
</table>
</body>
</html>
IV. Applying CSS code for Table Design
<style>
table {
border-collapse: collapse;
width: 100%;
}
table, th, td {
border: 1px solid black;
}
th, td {
padding: 10px;
}
th {
background-color: rgb(19, 110, 170);
color: white;
}
tr:hover {background-color: #f5f5f5;}
</style>
V. GUIDING EXERCISE 4
4. If we want to create a cell consisting of a combination of five rows, the attribute used
is …
A. colspan=”5”
B. rowspan=”5”
C. colspan=”five”
D. rowspan=”five”
5. If we want to create a cell consisting of a combination of five columns, the attribute used
is..
A. colspan=”5”
B. rowspan=”5”
C. colspan=”five”
D. rowspan=”five”