Tabel HTML: Membuat Tabel HTML Pertama Anda

Penjelasan Singkat Mengenai Tabel HTML

  • Sebuah tabel pada HTML didefinisikan menggunakan tag <table> , dan mengandung table cells<td>, singkatan dari “table data” ) yang berada di dalam tag table rows ( <tr>). Kode HTML untuk tabel adalah selalu berdasarkan baris terlebih dahulu, bukan kolom.
  • Table cells yang berada di baris paling atas atau header row ditulis menggunakan tag <th> (table header).
  • Table cells dapat digabung (merge) menggunakan tag colspan dan rowspan.
  • Tabel dapat dibagi menjadi tiga bagian sebagai berikut :
    • <thead> — Table header
    • <tbody> — Table body
    • <tfoot> — Table footer
  • Sebuah caption dapat ditambahkan ke dalam sebuah tabel menggunakan tag <caption>.
  • Anda dapat menggunakan <col> dan <colgroup> untuk membuat kolom tabel untuk keperluan desain.
  1. Contoh Tabel Sederhana

    Ini adalah sebuah contoh tabel HTML yang sangat sederhana. Copy kode ini di editor Anda, lalu jalankan di browser. Jika anda belum memiliki editor untuk pemrograman, silahkan cek post saya tentang Top 5 PHP Editor (IDE) untuk Pemrograman Web.

    <table>
    	<tr>
    		<th>Name</th>
    		<th>Favorite Color</th>
    	</tr>
    	<tr>
    		<td>Bob</td>
    		<td>Yellow</td>
    	</tr>
    	<tr>
    		<td>Michelle</td>
    		<td>Purple</td>
    	</tr>
    </table>

  2. Contoh Tabel HTML Kompleks

    <table>
      <caption>A complex table</caption>
      <thead>
        <tr>
          <th colspan="3">Invoice #123456789</th>
          <th>14 January 2025
        
        </tr>
        <tr>
          <td colspan="2"><strong>Pay to:</strong><br> Acme Billing Co.<br> 123
            Main St.<br> Cityville, NA 12345</td>
          <td colspan="2"><strong>Customer:</strong><br> John Smith<br> 321
            Willow Way<br> Southeast Northwestershire, MA 54321</td>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th>Name / Description</th>
          <th>Qty.</th>
          <th>@</th>
          <th>Cost</th>
        </tr>
        <tr>
          <td>Paperclips</td>
          <td>1000</td>
          <td>0.01</td>
          <td>10.00</td>
        </tr>
        <tr>
          <td>Staples (box)</td>
          <td>100</td>
          <td>1.00</td>
          <td>100.00</td>
        </tr>
      </tbody>
      <tfoot>
        <tr>
          <th colspan="3">Subtotal</th>
          <td>110.00</td>
        </tr>
        <tr>
          <th colspan="2">Tax</th>
          <td>8%</td>
          <td>8.80</td>
        </tr>
        <tr>
          <th colspan="3">Grand Total</th>
          <td>$ 118.80</td>
        </tr>
      </tfoot>
    </table>

Yang Dapat Kita Kembangkan Dengan Tabel HTML

Bootstrap adalah sebuah template CSS untuk membuat tabel HTML anda memiliki tampilan yang lebih baik. Hanya dengan memuatnya di halaman HTML Anda menggunakan tag <link>, Anda tinggal menggunakannya menggunakan class yang telah disediakan oleh Bootstrap. Contohnya, Anda dapat dengan mudah mengganti warna tabel, membuat warna selang seling pada baris tabel, membuat tabel tanpa garis dengan desain yang elegan, baris tabel yang dapat menyala ketika kursor melewatinya, dan masih banyak lagi. Coba sendiri kode Bootstrap Anda dengan membaca documentation tentang Bootstrap Table di sini.

Tabel yang ada pada halaman ini juga masih merupakan tabel statik, artinya datanya langsung diketikkan pada kode program. Ketika membuat tabel di sebuah website, pada umumnya kita memerlukan data yang dinamis, misalnya kita ambil data tersebut dari sebuah database. Pada postingan selanjutnya akan saya jelaskan bagaimana membuat tabel yang dinamis menggunakan PHP dan HTML.

3.075 comments

  1. resume writers north bay

    In the past, every resume opened by writing an Objective Statement – but no longer! Nowadays, employment experts all confirm, these types of phrases contribute nothing when evaluating your employment skills. This means, make sure to not write an Objective Statement!

  2. automaty do kawy

    Pretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed surfing around your blog posts. After all I?ll be subscribing to your feed and I hope you write again very soon!

  3. Kit Corbell

    Whether you’re preparing an spectacular vacation or going for a spur in the moment jaunt, sometimes, it’s the little details that can be the figuring out factor how a lot you prefer your time and effort away from home. The information in this article can help you plan the perfect vacation. Depart all unnecessary valuables in your house. You take the hazards of getting almost everything robbed by you should you bring valuable items along with you. If you are visiting a place that has a water-limitation on all fluids you could be preparing, put money into nightclub hair shampoos and tooth powder. Amazingly, you could discover club shampoo or conditioner and tooth paste obtainable in powder develop on the internet. These things are a great way to acquire about water-restrictions. When you are traveling in places with harmful regular faucet water, remember alternative methods which you might be revealed. Close the mouth area when using the shower area and brush your the teeth just with handled drinking water. If you make herbal tea or espresso using the water, allow it to boil for a number of a few minutes prior to steeping. A modest visibility can make you very ill. Get a journey dress, and that is a garment that may be worn a number of techniques. It may be used like a gown, skirt, tshirt and cover. You may then load a number of other accessories and accompanying products, which will save a lot of room with your baggage for those mementos you want to take property. Acquire several clothespins along whenever you travel. It is an unusual object to think about loading, even so they are often quite helpful. If you’re taking a cruise trip, be sure you take a compact working day bag along. You’ll discover that your suitcases won’t be around without delay if you table the ship. So you’ll want a case using a go swimming fit, a magazine, an extra modify of garments inside, and everything else you may need immediately. Regardless of where you would like to go, preparation can certainly make your journey all it might be. Utilize the suggestions you’ve read through on this page to have the most out of your travelling encounter.

  4. Derick Erler

    Can I just say what a relief to seek out somebody who actually is aware of what theyre talking about on the internet. You positively know methods to deliver a difficulty to gentle and make it important. More people have to read this and perceive this aspect of the story. I cant believe youre no more popular since you undoubtedly have the gift.

  5. pieczarkarnia

    hey there and thank you for your info ? I have definitely picked up something new from right here. I did however expertise some technical points using this web site, since I experienced to reload the site lots of times previous to I could get it to load properly. I had been wondering if your web hosting is OK? Not that I’m complaining, but sluggish loading instances times will sometimes affect your placement in google and could damage your quality score if advertising and marketing with Adwords. Well I?m adding this RSS to my email and could look out for much more of your respective exciting content. Make sure you update this again soon..

  6. Phuong Bridgforth

    This site is mostly a walk-by for the entire information you wanted about this and didn’t know who to ask. Glimpse here, and you’ll positively uncover it.

  7. Manuel Chesser

    I found your blog site on google and examine a number of of your early posts. Continue to keep up the superb operate. I simply additional up your RSS feed to my MSN Information Reader. Searching for ahead to reading more from you later on!…

  8. address

    Throughout this great design of things you actually get an A just for effort and hard work. Where you actually lost everybody ended up being in your particulars. You know, people say, the devil is in the details… And it couldn’t be much more true at this point. Having said that, let me reveal to you what did give good results. Your writing is definitely highly powerful and that is most likely the reason why I am taking an effort in order to comment. I do not make it a regular habit of doing that. Next, even though I can easily see the jumps in logic you make, I am not necessarily certain of just how you seem to connect your points which help to make the actual conclusion. For the moment I shall yield to your point however hope in the near future you link your dots better.

  9. Morton Zeccardi

    You could certainly see your skills within the paintings you write. The world hopes for even more passionate writers such as you who are not afraid to say how they believe. All the time follow your heart.

  10. QgvLQ

    Нашел интересный сайт!
    тут
    Взгляните

  11. insulin pen cooler travel case

    These offer a range of sizes to select from. There is a Small Double, Large and Extra-Large wallet, though each one has limited capacity.

  12. pompy ciepla pszczyna

    I think this is among the most significant information for me. And i’m glad reading your article. But wanna remark on few general things, The web site style is wonderful, the articles is really excellent : D. Good job, cheers

  13. sex ogloszenia towarzyskie przemysl

    Wow, marvelous blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your web site is magnificent, let alone the content!

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *