Thursday 6 July 2017

Membuat Tabel HTML


Halo sahabat MABEL..
Kembali lagi diblog Masih Belajar..

Melanjutkan materi ttg Pemrograman Web atau html yaitu membuat sebuah tabel.

Cekidot..

Dasar dari perintah membuat tabel

<table> -> Untuk membuat tabel
<tr> -> Untuk membuat 1 baris
<td> text </td> -> Untuk membuat 1 kolom
</tr>
</table>

Tambahan :
<table border=..> ( Untuk merubah border tabel
<td colspan=..> ( Untuk menggabungkan cell (kotak) ke kanan
<td rowspan=..> ( Untuk menggabungkan cell (kotak) ke bawah

Contoh :

<html>
<head>
<title> Latihan Membuat Tabel </title>
</head>

<body>
Selamat Datang di WEB Saya

<table border=2 width=100% hight=100%>
<tr>
<td> kolom 1 baris 1 </td>
<td> kolom 2 baris 1 </td>
<td> kolom 3 baris 1 </td>
</tr>

<tr>
<td> kolom 1 baris 2 </td>
<td> kolom 2 baris 2 </td>
<td> kolom 3 baris 2 </td>
</tr>

<tr>
<td> kolom 1 baris 3 </td>
<td> kolom 2 baris 3 </td>
<td> kolom 3 baris 3 </td>
</tr>
</table>

</body>
</html>

Hasil:

Penerapan Colspan dan Rowspan :

<html>
<head>
<title> Latihan Membuat Tabel </title>
</head>

<body>
Selamat Datang di WEB Saya

<table border=2 width=100% hight=100%>
<tr>
<td colspan=2> kolom 1 baris 1 </td>

<td> kolom 3 baris 1 </td>
</tr>

<tr>
<td rowspan=2> kolom 1 baris 2 </td>
<td> kolom 2 baris 2 </td>
<td> kolom 3 baris 2 </td>
</tr>

<tr>

<td> kolom 2 baris 3 </td>
<td> kolom 3 baris 3 </td>
</tr>
</table>

</body>
</html>

Hasil:

No comments:

Post a Comment