Open In App

How to create table cell using HTML5 ?

Last Updated : 14 Jul, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

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:




<!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


Output:

Supported Browsers are listed below:

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


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads