<th> vs <td>

gudii9 used Ask the Experts™
In the html world what is difference between
<th> vs <td>

when we use each under <tr> of <table>
please advise
can i use one another interchangeably?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Distinguished Expert 2017
The <td> tag, or "table data" tag, creates table cells within a table row in an HTML table. This is the HTML tag that contains any text and images. Basically, this is the element with the most usage .
The <th> is similar of <td> but we using it as a header of a table column
Bill PrewIT / Software Engineering Consultant
Top Expert 2016
The Mozilla Developer Network (MDN) is a great resource for information about HTML among other things.  Take a look at the page linked below for a good discussion on tables.

Default style of <th> elements is "font-weight: bold; "
You supposed to use <th>  inside <thead>, but actually it could be used instead of any <td>
Digital Marketing
The <th> tag defines a header cell in an HTML table.

An HTML table has two kinds of cells:

Header cells - contains header information (created with the <th> element)
Standard cells - contains data (created with the <td> element)
The text in <th> elements are bold and centered by default.

The text in <td> elements are regular and left-aligned by default.



Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial