How to create table cell using HTML5 ?

In this article, we will create cell in a table by using a combination of <tr> and <td> tag in a HTML table.

Syntax:

<table>
  <tr>
    <td> . . . </td>
    <td> . . . </td>
  </tr>
</table>

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>
        How to create a cell in 
        a table using HTML5?
    </title>
  
    <style>
        body {
            text-align: center;
        }
  
        h1 {
            color: green;
        }
  
        table,
        tbody,
        td {
            border: 1px solid black;
            border-collapse: collapse;
        }
    </style>
</head>
  
<body>
    <center>
        <h1>GeeksforGeeks</h1>
  
        <h2
            How to create a cell in 
            a table using HTML5?
        </h2>
          
        <table>
  
            <!-- tr tag starts here -->
            <tr>
                <td>Geeks</td>
                <td>For </td>
                <td>Geeks</td>
            </tr>
            <!-- tr tag end here -->
        </table>
    </center>
</body>
  
</html

chevron_right


Output:

Supported Browsers are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.