TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

HTML td Tag

HTML td Tag with html tutorial, tags, anchor, img, div, entity, textarea, marquee, p tag, heading tag, h1, h2, table, formatting, attribute, elements, ol, ul, Input Types, block element tag, inline element tag, html tags, phrase tag, head, body, form, lists, symbols etc.

<< Back to HTML

HTML <td> tag

HTML <td> tag is used to specify the cells of an HTML table which contain data of the table. The <td> tag must be the child element of <tr> (table row) tag. Each table row can contain multiple <td> data elements.

The grouped <td> elements of a <tr> tag renders as a single row in the table. The content of the <td> elements is regular and left-aligned in the table by default.

Syntax

  <td>.......</td>  

Display Inline
Start tag/End tag Start and End tag
Usage Table content

Example

<!DOCTYPE html>
<html>
<head>
	<title>HTML td tag</title>
	<style>
	th{
	 background-color: #6495ed;
	}
	th,td{
		border: 1px solid black;
		padding: 10px;
		}
	</style>
</head>
<body>
  <h2>Example of td Tag</h2>
  <table style=" border-collapse: collapse; background-color:#dcdcdc;">
       <tr>
  	<th>Product</th>
  	<th>Quantity</th>
  	<th>Price</th>
       </tr>

  	<tr>
  	    <td>Books</td>	
  	    <td>5</td>
  	     <td>589</td>
  	</tr>

  	<tr>
  	   <td>T-shirt</td>	
  	   <td>5</td>
  	   <td>3500</td>
  	</tr>
            
            <tr>
  	  <td>Jeans</td>	
  	    <td>2</td>
  	   <td>5000</td>
  	</tr>
  </table>
</body>
</html>
Test it Now

Output:

HTML td tag

Attribute:

Tag-specific attributes:

Attribute Value Description
abbr text It defines the abbreviated version of content of the cell. (Not Supported in HTML5)
align left
right
center
justify
char
It specifies the alignment of the content of the cell. (Not Supported in HTML5)
axis category_name It Categorizes Cells. . (Not Supported in HTML5)
bgcolor rgb(x,x,x)
#xxxxxx
Color_name
It sets the background color of the cell. (Not Supported in HTML5)
char character It specifies the alignment of the content of cell to the character. (Not Supported in HTML5)
charoff number It determines the number of characters the content aligned from the character specified by the char attribute. (Not Supported in HTML5)
colspan number It determines the number of columns a cell should span.
headers header_id It determines one or more header cells to which a cell is related.
height %
pixels
It determines the height of a table cell. (Not Supported in HTML5)
nowrap nowrap If it sets then content inside the cell should not wrap. (Not Supported in HTML5)
rowspan number It determines the number of rows a cell should span.
scope col
colgroup
row
rowgroup
It specifies the cells that the header element relates to. (Not Supported in HTML5)
valign top
middle
bottom
baseline
It determines the vertical alignment of the cell content. (Not Supported in HTML5)
width %
pixels
It determines the width of the cell.(Not Supported in HTML5)

Global attribute:

The <td> tag supports the Global attributes in HTML.

Event attribute:

The <td> tag supports the Event attributes in HTML.

Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<td>YesYesYesYesYes
Next TopicHTML template Tag




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf