HOW TO CREATE TABLES USING HTML AND CSS

On this blog you will also learn various things like:

  • How to add borders.
  • How to specify the cell padding, spacing, alignment.
  • How to insert image inside the table.

1. First step is to OPEN the notepad.

2. Inside the <section> element, type the code:
<h2>Best attractions in Singapore</h2>

3. Then type the code for the data of the table.


 HTML CODE:

<table>
<tr>
<td rowspan="2"></td>
<th>Marina Bay</th>
<th>Clarke Quay</th>
<th>Universal Studios</th>
<th>Gardens By the Bay</th>
<th>Raffles Hotel</th>
</tr>
<tr>
<td>SG</td>
<td>SG</td>
<td>SG</td>
<td>SG</td>
<td>SG</td>
</tr>
<tr>
<td>Information</td>
<td> 
Marina Bay in Singapore has undergone a transformation of epic proportions. Once a quiet body of water at the entrance of the Singapore River, this area now stands as a spectacular example of how this miniscule country has come to be one of the world’s most luxurious travel destinations.  Overlapping the Financial District, Clarke Quay and the central Civic District towards the north, Marina Bay boats some of Singapore’s most iconic hotels, skyscrapers, and attractions. It difficult to ignore the iconic Marina Bay Sands resort too, which itself is home to a substantial list of great things to do and see. This section is your guide to Marina Bay; from all the best hotels to restaurants, shopping, nightlife and attractions – we’ve got it all!
</td>
<td>Nightlife in Clarke Quay is what this party hub of Singapore is really famous. Dazzling lights, beautiful people and buzzing nightclubs – these are some of the things that imprint themselves on your mind the first time you visit Clarke Quay, Boat Quay and a kaleidoscope of concept bars and pubs along the Singapore River. A mind-boggling selection of themes and attractions round out your choice of after-sunset indulgence.  Originally a centre of commerce along the Singapore River, Clarke Quay is nowadays a labyrinth of restaurants, concept bars, retail stores and recreation outlets. Try Bar Cocoon or Bamboo Bar at The Forbidden City, Lunar Asian Fusion Bar for great shows, or Bar Opiume at the Empress Place by the riverside and then Attica or Canvas for an after-hours rave.  This comprehensive Clarke Quay nightlife section has all the best bars, pubs and clubs to hit.
</td>
<td>Universal Studios Singapore was the latest addition to Singapore’s attractions list. Opened in 2010, Universal Studios Singapore has seven themed sections with countless rides and shows, all related to major hit movies. The park is part of the US$4.5 billion Resorts World Sentosa Development. Start off in Hollywood. Strolling down Hollywood Boulevard will make you think that you’re in the States, not in a tropical Asian country. This is the main shopping area of the park. New York is based of course on the city of New York and here you can have your photo snapped with ‘movie stars’ such as Charlie Chaplin and Marilyn Monroe. Continue on to Sci-Fi city featuring a pair of the world’s tallest intertwining roller coasters among other things and then to Ancient Egypt where you will be faced with two massive guard statues. The atmosphere is truly that of ancient Egypt so get in to experience the ‘Revenge of the Mummy’ ride, a must for adults but not quite the best thing for young kids.
</td>
<td>Gardens by the Bay is a huge, colourful, futuristic park in the bay area of Singapore. The famous Supertree structures offer an impressive skywalk over the gardens, over-sized seashell-shaped greenhouses recreate chilly mountain climates and there are hundreds of trees and plants to discover, making this destination great fun for both kids and adults. The best place to grasp the size of Gardens by the Bay is from the top of Marina Bay Sands, which sits directly opposite the park, the space encompass 250 acres of reclaimed land on the waterfront. Getting here is easy, either via walkways from the hotel, giving you an elevated view of the gardens, or taking the slightly longer riverside promenade to enter the park near the two domes. Walking around the park won’t cost you a cent but if you want to step inside the climate-controlled conservatories, or walk amongst the Supertrees, there is a fee. The main park area is open from 9:00 to 21:00.
</td>
<td> The Raffles Hotela luxurious colonial-style hotel has a long history dating back to 1887 and has become one of the most important Singapore landmarks. Among famous guests are Elizabeth Taylor, Queen Elizabeth II and the late King of Pop, Michael Jackson. The Raffles Hotel features 103 suites and 18 distinctive restaurants and bars as well as an arcade with over 40 boutiques and stores (think Louis Vuitton and Tiffany & Co.) Many come for the Raffles Bar experience and you can be sure to enjoy the best Singapore Sling in town. After all, it was invented here and they’ve had almost 100 years of experience at making them.
</td>
</tr>
</table>

4. To add borders to the table,  type the css code:                            table{border-style:none;}                                                                    td{border-style:solid; border-width:1px; border-color:gray;}            th{border-style:solid; border-width:1px; border-color:gray;}          as an internal stylesheet inside the style tag with the attribute: type="text/css".                                                                                -after adding the css code add the attribute: cellspacing="0".

5. To specify the cell alignment, padding, and spacing: inside the tags just add the following attributes: cellpadding, padding, cellspacing, align, valign, and etc... For our table output add the following css codes inside the <style> tag:                                       th{width:130px; height:30px; padding:5px;}                                     .td1{width:130px; height:30px; padding:5px; text-align:center; vertical-align:middle;}                                                                         .sg{height:30px; padding:3px;}

6. Insert the class="sg" to the second row of the table:          <tr>  <tr>                                                                                                         <td class="sg">SG</td>
     <td class="sg">SG</td>
     <td class="sg">SG</td>
     <td class="sg">SG</td>
     <td class="sg">SG</td>
</tr>

7. Insert class="td1" to the other rows similar to this                <tr>
    <td class="td1">Information</td>
    <td class="td1">Marina Bay in Singapore has undergone a transformation of epic proportions. Once a quiet body of water at the entrance of the Singapore River, this area now stands as a spectacular example of how this miniscule country has come to be one of the world’s most luxurious travel destinations.  Overlapping the Financial District, Clarke Quay and the central Civic District towards the north, Marina Bay boats some of Singapore’s most iconic hotels, skyscrapers, and attractions. It difficult to ignore the iconic Marina Bay Sands resort too, which itself is home to a substantial list of great things to do and see. This section is your guide to Marina Bay; from all the best hotels to restaurants, shopping, nightlife and attractions – we’ve got it all!</td>
    <td class="td1">Nightlife in Clarke Quay is what this party hub of Singapore is really famous. Dazzling lights, beautiful people and buzzing nightclubs – these are some of the things that imprint themselves on your mind the first time you visit Clarke Quay, Boat Quay and a kaleidoscope of concept bars and pubs along the Singapore River. A mind-boggling selection of themes and attractions round out your choice of after-sunset indulgence.  Originally a centre of commerce along the Singapore River, Clarke Quay is nowadays a labyrinth of restaurants, concept bars, retail stores and recreation outlets. Try Bar Cocoon or Bamboo Bar at The Forbidden City, Lunar Asian Fusion Bar for great shows, or Bar Opiume at the Empress Place by the riverside and then Attica or Canvas for an after-hours rave.  This comprehensive Clarke Quay nightlife section has all the best bars, pubs and clubs to hit.</td>
    <td class="td1">Universal Studios Singapore was the latest addition to Singapore’s attractions list. Opened in 2010, Universal Studios Singapore has seven themed sections with countless rides and shows, all related to major hit movies. The park is part of the US$4.5 billion Resorts World Sentosa Development. Start off in Hollywood. Strolling down Hollywood Boulevard will make you think that you’re in the States, not in a tropical Asian country. This is the main shopping area of the park. New York is based of course on the city of New York and here you can have your photo snapped with ‘movie stars’ such as Charlie Chaplin and Marilyn Monroe. Continue on to Sci-Fi city featuring a pair of the world’s tallest intertwining roller coasters among other things and then to Ancient Egypt where you will be faced with two massive guard statues. The atmosphere is truly that of ancient Egypt so get in to experience the ‘Revenge of the Mummy’ ride, a must for adults but not quite the best thing for young kids.</td>
    <td class="td1">Gardens by the Bay is a huge, colourful, futuristic park in the bay area of Singapore. The famous Supertree structures offer an impressive skywalk over the gardens, over-sized seashell-shaped greenhouses recreate chilly mountain climates and there are hundreds of trees and plants to discover, making this destination great fun for both kids and adults. The best place to grasp the size of Gardens by the Bay is from the top of Marina Bay Sands, which sits directly opposite the park, the space encompass 250 acres of reclaimed land on the waterfront. Getting here is easy, either via walkways from the hotel, giving you an elevated view of the gardens, or taking the slightly longer riverside promenade to enter the park near the two domes. Walking around the park won’t cost you a cent but if you want to step inside the climate-controlled conservatories, or walk amongst the Supertrees, there is a fee. The main park area is open from 9:00 to 21:00.</td>
    <td class="td1">The Raffles Hotel, a luxurious colonial-style hotel has a long history dating back to 1887 and has become one of the most important Singapore landmarks. Among famous guests are Elizabeth Taylor, Queen Elizabeth II and the late King of Pop, Michael Jackson. The Raffles Hotel features 103 suites and 18 distinctive restaurants and bars as well as an arcade with over 40 boutiques and stores (think Louis Vuitton and Tiffany & Co.) Many come for the Raffles Bar experience and you can be sure to enjoy the best Singapore Sling in town. After all, it was invented here and they’ve had almost 100 years of experience at making them.</td>
</tr>

OUTPUT:






                                                                         














Comments

  1. i really wanna go to singapore even at least once in my life....

    ReplyDelete
  2. Can't wait to go back! ��������

    ReplyDelete
  3. You gave me reasons to love this country more!!!

    ReplyDelete
  4. Two thumbs up for this fantastic place!

    ReplyDelete
  5. PLANNING TO GO HERE NEXT YEAR AGAIN :)

    ReplyDelete
  6. And by the way... SG has the best friedrice. Yummmerssss

    ReplyDelete
  7. And also DOLLAR VALUE shopping spreeee. Hehehe love that store can buy soooooo many chocolates that costs a dollar only, yey

    ReplyDelete
  8. New info in another country gained🤟

    ReplyDelete
  9. Now i have ideas where to go whenever i'll visit SG someday😆👍

    ReplyDelete
  10. Waaahhh this makes me wanna go to SG too❤️❤️

    ReplyDelete
  11. I LOVE IT THESE IS SO NICE! AMAZING AND AWESOME!

    ReplyDelete
  12. Wow i have an idea if I want to go to singapore,where best destinations gives me a nice and positive vibes

    ReplyDelete
  13. this is nice 👍🏻

    ReplyDelete
  14. Wow! I was really impressed! This blog is great, i will go to singapore if given a chance. Hahaha

    ReplyDelete
  15. It is nice to see the beautiful places in Singapore

    ReplyDelete
  16. Aside from KOREA, I really want to go @SG 😍 If there will be a budget and given a chance... HAHAHA I'll visit those places featured here 😉

    ReplyDelete
    Replies
    1. I'm glad i made u remember a place you'd want to go to someday. I'm glad u liked it.

      Delete

Post a Comment