Header Ads

Learn HTML TD Tag with Syntax & Examples

 What is the HTML  <td> tag

html td tag


What is the HTML  <td> tag


✷ The <td> tag in HTML stands for Table Data. It is used to define a data cell inside a table. The <td> tag is always placed inside a table row <tr> and is used to display actual content such as text, numbers, or images.

✷ The basic syntax looks like this:

✷ <td>Data here</td>

✷ Each <td> element represents one cell in a row. Multiple <td> tags are used within a <tr> to create columns in a table.

✷ Here is a simple example:

<table border="1">
    <tr>
        <td>Rahul</td>
        <td>25</td>
    </tr>
</table>

✷ In this example, “Rahul” and “25” are displayed in two separate cells within the same row.

✷ The <td> tag can contain different types of content, including text, images, links, or even other HTML elements. It is an essential part of creating tables and organizing data in rows and columns.

What is the HTML  <td> tag

Example 


<!DOCTYPE html>
<html>
    <head>
        <title> html td tag </title>
        <style>
          table,th,td{
              border:2px solid rgb(212, 7, 7);
          }
        </style>
            </head>
            <body>
                <h2>HTML td Tag  </h2>
                <P> Learn Free programming languag :-
<br>webdesigningtheory.blogspot.com</P>
                <table>
                      <tr>
                        <th>Subject </th>
                        <th>Learn </th>
                          </tr>
                           <tr>
                        <td>HTML</td>
                        <td>Free </td>
                          </tr>                  
                          <tr>
                            <td>PHP</td>
                            <td>Free</td>
                          </tr>
                          <tr>
                            <td>JavaScript </td>
                            <td>Free</td>
                          </tr>
                </table>
            </body>
</html>

What is the HTML  <td> tag

Explain Program

Step  1] 

<!DOCTYPE html>

This declare the document type.

browser that the document is written in html

Step 2 ]

<html>.... . </html>

html is the root element of the html page.

 Every thing inside it is part of the webpage.

Step 3]

<head>.....</head>

head section contain metadata  about the webpage information 

for the browser not display on the webpage.

<title> html td tag </title>

 sets the title of page appears the browser tab

 
<style>
          table,th,td {
              border:2px solid rgb(212, 7, 7);
          }

  •   HTML code Apply the Style <table>,<th>,<td>.
  •   2 px solid red color    

   CSS applies 

  • <style> Tag 
  • <style> tag use to include CSS (Cascading Style Sheets) directly within HTML Document .
  • Inside the <head> Section html.
   
</style>
       .
.
    .
</style>

 CSS code defines HTML element 

<body>.....</body>

  • <body> tag contains  all the visible content of the page.
  • inside <body> show the browser screen. 

Step 4]

<body>

 body section  tag every data inside <body> is visible on web page.

<h2>HTML tr Tag  </h2>

webpage  page shows heading on the page.

Step 5]

 
<P> Learn Free programming languag :- <br>webdesigningtheory.blogspot.com</P>
             

  • <P>  (Paragraph)  tag 
  •  <p> tag Create a paragraph.
  • <br> add line break moving text to next line.

 row creates headings 

Step 6]


<table>
         

HTML  <table> tag Start of Table

Step 7]

 
                    <tr>
                        <th>Subject </th>
                        <th>Learn </th>
                          </tr>
                       

 first  Table Header row 

  •    <tr>   =  table row                    
  •   <th>  = table header cell 

Step 8]

 
<table>                     
                           <tr>
                        <td>HTML</td>
                        <td>Free </td>
                          </tr>                  
                          <tr>
                            <td>PHP</td>
                            <td>Free</td>
                          </tr>
                          <tr>
                            <td>JavaScript </td>
                            <td>Free</td>
                          </tr>
                </table>

Second Row 

  •   <td>   = table data cell
  •   <td> tag row displays.

     HTML | Free

Third Row 

  •   <td>   = table data cell
  •   <td> tag row displays. 

      PHP | Free

Fourth Row 

  •   <td>   = table data cell
  •   <td> tag row displays.

       JavaScript | Free

Step 9]

closing the Tag

</table>
            </body>
</html>

What is the HTML  <td> tag

Output


What is the HTML  <td> tag






Related Post :-

how to use the video tag in html

how to create a horizontal frameset in html

how to create top navigation menu

No comments

Powered by Blogger.