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.

2.858 comments

  1. 수원출장

    A fascinating discussion is definitely worth comment. I do believe that you should write more on this subject, it may not be a taboo matter but generally folks don’t talk about such subjects. To the next! Best wishes!!

  2. 수원출장

    There is definately a lot to know about this topic. I really like all the points you have made.

  3. Weblink

    I was more than happy to seek out this net-site.I needed to thanks for your time for this glorious read!! I positively having fun with each little bit of it and I have you bookmarked to take a look at new stuff you weblog post.

  4. windows 10 home cost

    Excellent blog! Do you have any tips and hints for aspiring writers? I’m planning to start my own site soon but I’m a little lost on everything. Would you recommend starting with a free platform like WordPress or go for a paid option? There are so many choices out there that I’m totally confused .. Any recommendations? Thanks!

  5. windows 10 home pro price

    Thanks for some other excellent article. Where else could anyone get that type of information in such an ideal approach of writing? I’ve a presentation subsequent week, and I am at the look for such information.

  6. thtopcasino.com

    I’m more than happy to uncover this great site.
    I want to to thank you for your time for this particularly fantastic read!!
    I definitely appreciated every part of it and i also have you
    bookmarked to check out new information in your web site.

  7. windows 10 home retail

    I simply could not leave your web site prior to suggesting that I really enjoyed the standard information a person supply on your visitors? Is gonna be again steadily in order to investigate cross-check new posts

  8. Click Site

    Undeniably consider that that you said. Your favourite justification appeared to be on the internet the simplest thing to be mindful of. I say to you, I definitely get annoyed at the same time as other folks consider issues that they plainly do not know about. You controlled to hit the nail upon the highest and also outlined out the whole thing with no need side-effects , people could take a signal. Will likely be again to get more. Thanks

  9. buy windows 10 home cd

    Great write-up, I’m regular visitor of one’s web site, maintain up the nice operate, and It’s going to be a regular visitor for a long time.

  10. detektyw warszawa

    I was recommended this website by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my trouble. You’re incredible! Thanks!

  11. okna katowice

    Its like you read my mind! You seem to know a lot about this, like you wrote the book in it or something. I think that you could do with a few pics to drive the message home a little bit, but other than that, this is excellent blog. A great read. I’ll certainly be back.

  12. dieta pudelkowa

    Its like you read my mind! You seem to know a lot about this, like you wrote the book in it or something. I think that you can do with a few pics to drive the message home a little bit, but other than that, this is magnificent blog. A fantastic read. I will definitely be back.

  13. Catering dietetyczny Warszawa

    Fantastic beat ! I wish to apprentice while you amend your site, how can i subscribe for a blog web site? The account helped me a acceptable deal. I had been tiny bit acquainted of this your broadcast provided bright clear idea

  14. tabletki wczesnoporonne

    Hi there, You’ve done an incredible job. I will definitely digg it and personally recommend to my friends. I am sure they’ll be benefited from this website.

  15. optyk bialystok

    Nice post. I was checking continuously this blog and I’m impressed! Very useful information specially the last part 🙂 I care for such info much. I was seeking this particular info for a very long time. Thank you and best of luck.

  16. 먹튀검증커뮤니티

    I would like to thank you for the efforts you’ve put in penning this blog. I am hoping to see the same high-grade blog posts by you later on as well. In truth, your creative writing abilities has motivated me to get my own website now 😉

  17. Detektyw Warszawa

    I loved as much as you will receive carried out right here. The sketch is attractive, your authored subject matter stylish. nonetheless, you command get got an impatience over that you wish be delivering the following. unwell unquestionably come further formerly again as exactly the same nearly very often inside case you shield this increase.

  18. audyt sledczy

    I think this is among the most important info for me. And i am glad reading your article. But wanna remark on some general things, The website style is great, the articles is really nice : D. Good job, cheers

  19. windows 8 price

    Excellent weblog right here! Also your web site rather a lot up very fast! What host are you using? Can I get your associate hyperlink in your host? I desire my website loaded up as fast as yours lol

  20. buy windows 8 product key

    I just couldn’t depart your site before suggesting that I extremely enjoyed the standard info a person provide for your visitors? Is gonna be back often in order to check up on new posts

  21. microsoft windows 8.1

    I really appreciate this post. I’ve been looking everywhere for this! Thank goodness I found it on Bing. You have made my day! Thx again

  22. microsoft windows 8

    I really appreciate this post. I’ve been looking all over for this! Thank goodness I found it on Bing. You have made my day! Thx again

  23. Link

    Thanks a lot for sharing this with all of us you actually know what you are talking about! Bookmarked. Kindly also visit my website =). We could have a link exchange contract between us!

  24. parkiety z calego swiata

    Hi there, You have done a fantastic job. I will certainly digg it and personally recommend to my friends. I’m sure they will be benefited from this site.

  25. purchase windows 8.1

    Woah! I’m really enjoying the template/theme of this blog. It’s simple, yet effective. A lot of times it’s hard to get that “perfect balance” between user friendliness and visual appearance. I must say that you’ve done a excellent job with this. Additionally, the blog loads extremely quick for me on Firefox. Superb Blog!

  26. Visit Website

    Hey there, You have done an incredible job. I will definitely digg it and personally recommend to my friends. I am sure they will be benefited from this web site.

  27. Visit Website

    Hello, Neat post. There is a problem with your website in web explorer, might check this… IE nonetheless is the marketplace chief and a large section of folks will miss your fantastic writing due to this problem.

  28. 먹튀사이트

    I love looking through a post that can make people think. Also, many thanks for allowing for me to comment!

  29. Catering dietetyczny Warszawa

    It’s the best time to make some plans for the future and it’s time to be happy. I’ve read this post and if I could I want to suggest you few interesting things or advice. Maybe you could write next articles referring to this article. I desire to read even more things about it!

Tinggalkan Balasan

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