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.

4.129 comments

  1. Moshe Pfund

    Hi would you mind sharing which blog platform you’re working with? I’m going to start my own blog soon but I’m having a difficult time deciding between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design seems different then most blogs and I’m looking for something completely unique. P.S My apologies for getting off-topic but I had to ask!

  2. Cacophonyfarm.com

    Wrіte more, thats аll I have to saү. Literally, it seems
    as thoɡh you relied onn the video to make уor point. You obviously know
    what youre talking about, why throw away your intelⅼigencе on just posting
    videos to your blog when you could bbe giѵing us ѕomething informativе to read?

    My blogg – Agen Sbobеt88 (Cacophonyfarm.com)

  3. novo casino online

    Your style is really unique in comparison to other folks I have
    read stuff from. Thanks for posting when you’ve
    got the opportunity, Guess I will just bookmark this page.

  4. https://Casasdeapostas.xyz

    Every weekend i used to pay a visit this web site, as i want enjoyment, as this this
    website conations really nice funny information too.

  5. mike-wiki.win

    һey there аnd thank you for your info –I have certainly picked up something
    new fr᧐m right here. I did howеver expertise a few technical
    issues using this weƄsite, as I experienced to reloɑd the website many times prеvious to I could get it tto load correϲtly.
    I had been wpndeгіng if your wеb host
    is OK? Not thbat I’m complaining, but sluggіsh loading instances times will sometіmes
    affeft your placement in google and cаn damage your һigh quality score if advertising and marketing ѡith Adwоrds.
    Ꮤell I’m adding ths RSS to my e-mail and could
    lօkok outt for a lot more оf your reѕpective nteresting content.
    Ensure that you update this agan νery soon.

    Take a look aat my site: situs ѕⅼot online terbaik – mike-wiki.win

  6. weight loss hypnosis va beach

    There are incredibly a great deal of details this way to take into consideration. That’s a great specify start up. I provide thoughts above as general inspiration but clearly you’ll find questions like the one you mention in which the most significant thing will likely be in the honest good faith. I don?t know if best practices have emerged around items like that, but I am sure that your chosen job is clearly identified as a good game. Both youngsters feel the impact of only a moment’s pleasure, through-out their lives.

  7. this link

    Ahaa, its good discussion regarding this post here at this website, I have read all that, so at this time me also commenting here.

  8. marijuana dealscannabis deals

    I’m excited to find this website. I wanted to thank you for your time just for this
    fantastic read!! I definitely loved every part of it and i also have
    you saved as a favorite to see new things in your
    web site.

  9. cannabis

    Good information. Lucky me I recently found your website by chance (stumbleupon).
    I’ve book-marked it for later!

  10. was asmr

    You really make it appear so easy together with your presentation however I to find
    this topic to be really one thing which I think I might
    never understand. It sort of feels too complex and very
    vast for me. I’m having a look ahead in your next put up, I’ll attempt to get the dangle of it!

  11. cbd sale

    Wonderful blog! Do you have any suggestions for aspiring writers?
    I’m hoping to start my own blog soon but I’m a little lost on everything.
    Would you advise 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 suggestions? Thank you!

  12. https://spinalhub.win/

    It’s awesome in support of me to have a web site, which is valuable for my experience.
    thanks admin

  13. cannabis

    Hi there! Someone in my Myspace group shared this website with
    us so I came to look it over. I’m definitely enjoying the information. I’m bookmarking and will be tweeting this to my followers!
    Excellent blog and great design and style.

  14. Carlton

    Somebody necessarily help to make significantly posts I might state.
    This is the first time I frequented your website page and to this point?
    I amazed with the analysis you made to make this actual publish extraordinary.
    Excellent process!

  15. cbd sale

    Hi it’s me, I am also visiting this website regularly, this web site is
    in fact pleasant and the users are genuinely sharing fastidious
    thoughts.

  16. cannabis

    It’s enormous that you are getting thoughts from this post
    as well as from our dialogue made at this time.

  17. marijuana dealscannabis deals

    Hello there I am so thrilled I found your blog page, I
    really found you by error, while I was browsing on Google for something else,
    Anyhow I am here now and would just like to say thank you for a
    tremendous post and a all round exciting blog (I also love the theme/design), I don’t have time
    to read it all at the minute but I have bookmarked it and
    also added your RSS feeds, so when I have time I will be back to
    read a great deal more, Please do keep up the awesome jo.

  18. Tara

    Link exchange is nothing else but it is just placing the
    other person’s website link on your page at suitable place and other person will also do similar in support of you.

  19. https://bookmarkzones.trade

    Hello this is somewhat of off topic but I was wondering if blogs use WYSIWYG editors or
    if you have to manually code with HTML. I’m starting a blog soon but have no coding
    knowledge so I wanted to get advice from someone with experience.

    Any help would be greatly appreciated!

  20. cbd deals

    Great post however , I was wanting to know if you could write a litte more on this subject?

    I’d be very grateful if you could elaborate a little bit
    more. Cheers!

Tinggalkan Balasan

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