Tujuan :
1. Membuat tabel menggunakan HTML
2. Membuat borders pada tabel
3. Membuat ukuran pada tabel
4. Membuat header pada table
5. Membuat padding & Spacing pada tabel
6. Membuat Colspan & Rowspan pada tabel
7. Membuat Table Styling
8. Membuat Table Colgrup
Tag Description
<table> Mendefinisikan tabel
<th> Mendefinisikan sel header dalam tabel
<tr> Mendefinisikan baris dalam tabel
<td> Mendefinisikan sel dalam tabel
<caption> Mendefinisikan judul tabel
<colgroup> Menentukan grup dari satu atau lebih kolom dalam tabel untuk pemformatan
<col> Menentukan properti kolom untuk setiap kolom dalam elemen <colgroup>
<thead> Mengelompokkan konten header dalam sebuah tabel
<tbody> Mengelompokkan konten isi dalam tabel
<tfoot> Mengelompokkan konten footer dalam tabel
<!DOCTYPE html>
<html>
<body>
<h2>Dasar HTML Tabel</h2>
<hr>
<h2>Satu Kolom:</h2>
<table>
<tr>
<td>100</td>
</tr>
</table>
<hr>
<h2>Satu Baris dan Tiga Kolom:</h2>
<table>
<tr>
<td>100</td>
<td>200</td>
<td>300</td>
</tr>
</table>
<hr>
<h2>Tiga Baris dan Tiga Kolom:</h2>
<table>
<tr>
<td>100</td>
<td>200</td>
<td>300</td>
</tr>
<tr>
<td>400</td>
<td>500</td>
<td>600</td>
</tr>
<tr>
<td>700</td>
<td>800</td>
<td>900</td>
</tr>
</table>
<hr>
</body>
</html>
Hasilnya :
C. Membuat border pada tabel
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<h2>Membuat Border atau Batas pada Tabel</h2>
<p>Gunakan property border CSS untuk membuat border pada tabel</p>
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>NIDN</th>
</tr>
<tr>
<td>Dandi</td>
<td>Sunardi</td>
<td>0201088101</td>
</tr>
</table>
</body>
</html>
Hasilnya :
D. Membuat Border Collapse
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
</style>
</head>
<body>
<h2>Collapse Border </h2>
<p>Dengan menggunakan collapse border maka garis hanya akan tampak
satu</p>
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>NIDN</th>
</tr>
<tr>
<td>Dandi</td>
<td>Sunardi</td>
<td>0201088101</td>
</tr>
</table>
</body>
</html>
Hasilnya :
E. Table Padding & Spacing
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 15px;
}
</style>
</head>
<body>
<h2>Cellpadding</h2>
<p>Cell padding specifies the space between the cell content and its borders.</p>
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>NIDN</th>
</tr>
<tr>
<td>Dandi</td>
<td>Sunardi</td>
<td>0201088101</td>
</tr>
</table>
<p>Try to change the padding to 5px.</p>
</body>
</html>
Hasilnya :
F. Membuat Rataan Kiri Teks Heading pada Tabel (default heading “center”)
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 5px;
}
th, td {
text-align:;
}
</style>
</head>
<body>
<h2>Rataan Kiri pada Headings</h2>
<p>Untuk Rataan Kiri Teks pada Heading, harus menggunakan elemen CSS text-align
</p>
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>NIDN</th>
</tr>
<tr>
<td>Dandi</td>
<td>Sunardi</td>
<td>0201088101</td>
</tr>
</table>
</body>
</html>
Hasilnya :
G. Horizontal/Vertical table headings
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 5px;
text-align: left;
}
</style>
</head>
<body>
<h2>Horizontal Headings:</h2>
<table style="width:100%">
<tr>
<th>Nama</th>
<th>Alamat</th>
<th>Telephone</th>
</tr>
<tr>
<td>Dandi Sunardi</td>
<td>Kampung Bali</td>
<td>085377105566</td>
</tr>
</table>
<h2>Vertical Headings:</h2>
<table style="width:100%">
<tr>
<th>Nama:</th>
<td>Dandi Sunardi</td>
</tr>
<tr>
<th>Alamat:</th>
<td>Kampung Bali</td>
</tr>
<tr>
<th>Telephone:</th>
<td>085377105566</td>
</tr>
</table>
</body>
</html>
H. Membuat Caption Tabel
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 5px;
text-align: left;
}
</style>
</head>
<body>
<h2>Table Caption</h2>
<p>To add a caption to a table, use the caption tag</p>
<table style="width:100%">
<caption>Alamat Dosen</caption>
<tr>
<th>Nama Dosen</th>
<th>Alamat</th>
</tr>
<tr>
<td>Dandi Sunardi</td>
<td>Kampung Bali</td>
</tr>
<tr>
<td>Solehan</td>
<td>Kampung Bali</td>
</tr>
</table>
</body>
</html>
I. Membuat Cell Span untuk Kolom menggunakan “colspan”
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 5px;
text-align: left;
}
</style>
</head>
<body>
<h2>Cell that spans two columns</h2>
<p>To make a cell span more than one column, use the colspan attribute</p>
<table style="width:100%">
<tr>
<th>Name</th>
<th colspan="2">Telephone</th>
</tr>
<tr>
<td>Dandi Sunardi</td>
<td>085377105566</td>
<td>085300000000</td>
</tr>
</table>
</body>
</html>
J. Membuat Cell Span untuk Rows menggunakan “rowspan”
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 5px;
text-align: left;
}
</style>
</head>
<body>
<h2>Cell that spans two rows</h2>
<p>To make a cell span more than one row, use the rowspan attribute.</p>
<table style="width:100%">
<tr>
<th>Nama:</th>
<td>Dandi Sunardi</td>
</tr>
<tr>
<th rowspan="2">Telephone:</th>
<td>085377105566</td>
</tr>
<tr>
<td>085300000000</td>
</tr>
</table>
</body>
</html>
A. HTML FORMS
1. Form with text input
<!DOCTYPE html>
<html>
<body>
<h2>Text input fields</h2>
<form>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe">
</form>
<p>Note that the form itself is not visible.</p>
<p>Also note that the default width of text input fields is 20 characters.</p>
</body>
</html>
4. An input button
<!DOCTYPE html>
<html>
<body>
<h2>The button Element</h2>
<button type="button" onclick="alert('Hello World!')">Click Me!</button>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>Telephone Field</h2>
<p>The <strong>input type="tel"</strong> is used for input fields that should contain a telephone
number:</p>
<form action="/action_page.php">
<label for="phone">Enter a phone number:</label><br><br>
<input type="tel" id="phone" name="phone" placeholder="123-45-678" pattern="[0-9]{3}-[0-9]{2}-[0-
9]{3}" required><br><br>
<small>Format: 123-45-678</small><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h1>The autocomplete attribute</h1>
<p>The autocomplete attribute specifies whether or not an input field should have autocomplete
enabled.</p>
<p>Fill in and submit the form, then reload the page to see how autocomplete works.</p>
<p>Notice that autocomplete is "on" for the form, but "off" for the e-mail field!</p>
<form action="/action_page.php" autocomplete="on">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email" autocomplete="off"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h1>The form novalidate attribute</h1>
<p>The novalidate attribute specifies that the form data should not be validated when submitted.</p>
<form action="/action_page.php" novalidate>
<label for="email">Enter your email:</label>
<input type="email" id="email" name="email" required><br><br>
<input type="submit" value="Submit">
</form>
<p><strong>Note:</strong> The novalidate attribute of the form tag is not supported in Safari 10 (or
earlier).</p>
</body>
</html>
3. The autofocus_attribute
<!DOCTYPE html>
<html>
<body>
<h1>The input autofocus attribute</h1>
<p>The autofocus attribute specifies that the input field should automatically get focus when the page
loads.</p>
<form action="/action_page.php">
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" autofocus><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h1>The input form attribute</h1>
<p>The form attribute specifies the form an input element belongs to.</p>
<form action="/action_page.php" id="form1">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br><br>
<input type="submit" value="Submit">
</form>
<p>The "Last name" field below is outside the form element, but still part of the form.</p>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname" form="form1">
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h1>The input formaction attribute</h1>
<p>The formaction attribute specifies the URL of a file that will process the input when the form is
submitted.</p>
<form action="/action_page.php">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br><br>
<input type="submit" value="Submit">
<input type="submit" formaction="/action_page2.php" value="Submit as Admin">
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h1>The input formenctype attribute</h1>
<p>The formenctype attribute specifies how the form data should be encoded when submitted.</p>
<form action="/action_page_binary.asp" method="post">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br><br>
<input type="submit" value="Submit">
<input type="submit" formenctype="multipart/form-data" value="Submit as Multipart/form-data">
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h1>The input formmethod Attribute</h1>
<p>The formmethod attribute defines the HTTP method for sending form-data to the action URL.</p>
<form action="/action_page.php" method="get" target="_blank">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br><br>
<input type="submit" value="Submit using GET">
<input type="submit" formmethod="post" value="Submit using POST">
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<!DOCTYPE html>
<html>
<body>
<h1>The input height and width attributes</h1>
<p>The height and width attributes specify the height and width of an input type="image" element.</p>
<form action="/action_page.php">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br><br>
<input type="image" src="img_submit.gif" alt="Submit" width="48" height="48">
</form>
<p><b>Note:</b> The input type="image" sends the X and Y coordinates of the click that activated the
image button.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h1>The input min and max attributes</h1>
<p>The min and max attributes specify the minimum and maximum values for an input element.</p>
<form action="/action_page.php">
<label for="datemax">Enter a date before 1980-01-01:</label>
<input type="date" id="datemax" name="datemax" max="1979-12-31"><br><br>
<label for="datemin">Enter a date after 2000-01-01:</label>
<input type="date" id="datemin" name="datemin" min="2000-01-02"><br><br>
<label for="quantity">Quantity (between 1 and 5):</label>
<input type="number" id="quantity" name="quantity" min="1" max="5"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
13. The multiple attribute
<!DOCTYPE html>
<html>
<body>
<h1>The input multiple attributes</h1>
<p>The multiple attribute specifies that the user is allowed to enter more than one value in an input
field.</p>
<form action="/action_page.php">
<label for="files">Select files:</label>
<input type="file" id="files" name="files" multiple><br><br>
<input type="submit" value="Submit">
</form>
<p>To select multiple files, hold down the CTRL or SHIFT key while selecting.</p>
</body>
</html>
14. The pattern attribute
<!DOCTYPE html>
<html>
<body>
<h1>The input pattern attribute</h1>
<p>The pattern attribute specifies a regular expression that the input element's value is checked
against.</p>
<form action="/action_page.php">
<label for="country_code">Country code:</label>
<input type="text" id="country_code" name="country_code" pattern="[A-Za-z]{3}" title="Three letter
country code"><br><br>
<input type="submit" value="Submit">
</form>
<p><strong>Note:</strong> The pattern attribute of the input tag is not supported in Safari 10 (or
earlier).</p>
</body>
</html>
15. The placeholder attribute
<!DOCTYPE html>
<html>
<body>
<h1>The input placeholder attribute</h1>
<p>The placeholder attribute specifies a short hint that describes the expected value of an input
field.</p>
<form action="/action_page.php">
<label for="phone">Enter a phone number:</label>
<input type="tel" id="phone" name="phone" placeholder="123-45-678" pattern="[0-9]{3}-[0-9]{2}-[0-
9]{3}"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
16. The required attribute
<!DOCTYPE html>
<html>
<body>
<h1>The input required attribute</h1>
<p>The required attribute specifies that an input field must be filled out before submitting the form.</p>
<form action="/action_page.php">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
<input type="submit" value="Submit">
</form>
<p><strong>Note:</strong> The required attribute of the input tag is not supported in Safari prior version
10.1.</p>
</body>
</html>
17. The step attribute
<!DOCTYPE html>
<html>
<body>
<h1>The input step attribute</h1>
<p>The step attribute specifies the legal number intervals for an input element.</p>
<form action="/action_page.php">
<label for="points">Points:</label>
<input type="number" id="points" name="points" step="3">
<input type="submit" value="Submit">
</form>
</body>
</html>
K. Sumber
- https://www.w3schools.com/
- https://www.petanikode.com/
- https://www.codepolitan.com/
- https://dosenit.com/jaringan-komputer/internet/pengertian-internet-menurut-ahli
- https://www.brilio.net/wow/50-pantun-nasihat-islami-penuh-makna-dan-mendidik-
210616u.html
- https://jambi.kemenag.go.id/news/8001/puasa-ramadhan-itu-madrasah.html
- https://www.infohpmurah.com/2018/08/31-contoh-puisi-islami-menyentuh-hati.html