Belajar HTML Table

Nama: Azka Rizqullah Ramadhani

NRP: 5025231148

Kelas: Pemrograman Web (E)

Pertemuan: 3


Deskripsi

Latihan Membuat table menggunakan HTML dan CSS.


Code:
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      body {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
      }
      table,
      th,
      td {
        margin-top: 100px;
        border: 1px solid black;
      }
      .table-2 {
        border-collapse: collapse;
        margin-top: 100px;
        width: 30%;
      }
    </style>
  </head>
  <body>
    <table>
      <tr>
        <th colspan="3" style="background-color: yellow">Produk Unggulan</th>
      </tr>
      <tr>
        <td rowspan="4">
          <img src="html-5.png" width="150px" height="150px" />
        </td>
        <td>Nama</td>
        <td>Table Benih</td>
      </tr>
      <tr>
        <td>Harga</td>
        <td>Rp 192.000</td>
      </tr>
      <tr>
        <td>Fitur</td>
        <td>
          <ul>
            <li>Dilengkapi Dokumentasi</li>
            <li>Ukuran: 31MB</li>
            <li>Masa Tanam: 6 bulan</li>
            <li>Lisensi: MIT</li>
          </ul>
        </td>
      </tr>
    </table>
    <table class="table-2">
      <tr>
        <th
          rowspan="2"
          style="background-color: rgb(58, 58, 182); color: white"
        >
          Nama
        </th>
        <th
          colspan="3"
          style="background-color: rgb(58, 58, 182); color: white"
        >
          Nilai
        </th>
      </tr>
      <tr style="background-color: rgb(58, 58, 182); color: white">
        <th>Kimia</th>
        <th>Fisika</th>
        <th>Biologi</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>

Komentar

Postingan populer dari blog ini

Javascript