HTML:
| Attribute | Description | HTML Compatibility |
|---|---|---|
| align | Alignment of the table. It can be one of the following values: left, center, right | Deprecated, use CSS |
| bgcolor | Background color of the table | Deprecated, use CSS |
| border | Size of the frame surrounding table (in pixels) | Deprecated, use CSS |
| cellpadding | Space between the content of a cell and the border (in pixels) | Deprecated, use CSS |
| cellspacing | Size of the space between cells (in pixels) | Deprecated, use CSS |
| frame | Side of the table frame is displayed. It can be one of the following values: above, hsides, lhs, border, void, below, vsides, rhs, box | Deprecated, use CSS |
| rules | Lines that should be displayed. It can be one of the following values: none, groups, rows, columns, all | Deprecated, use CSS |
| summary | Alternative text displayed when table can not be displayed | Deprecated, use CSS |
| width | Width of the table | Deprecated, use CSS |
Note
- The HTML <table> element is found within the <body> tag.
- The <table> tag is made up of <tr>, <th>, and <td> tags.
- The <tr> tag defines the table rows. There must be at least one row in the table.
- The <th> tag defines the header cells in the table which are displayed as bold, center-aligned text.
- The <td> tag defines the standard cells in the table which are displayed as normal-weight, left-aligned text.
Browser Compatibility
The <table> tag is compatible with the following browsers:
- Chrome
- Android
- Firefox (Gecko)
- Firefox Mobile (Gecko)
- Internet Explorer (IE)
- Edge Mobile
- Opera
- Opera Mobile
- Safari (WebKit)
- Safari Mobile
Example
We will discuss the <table> tag below, exploring examples of how to use the <table> tag in HTML5, HTML 4.01 Transitional, XHTML 1.0 Transitional, XHTML 1.0 Strict, and XHTML 1.1.
- HTML5
- HTML4
- XHTML
HTML5 Document
If you created a new web page in HTML5, your <table> tag might look like this:
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>HTML5 Example by www.techonthenet.com</title> </head> <body> <table> <tr> <th>Column 1 Heading</th> <th>Column 2 Heading</th> <th>Column 3 Heading</th> </tr> <tr> <td>Data in Column 1, Row 2</td> <td>Data in Column 2, Row 2</td> <td>Data in Column 3, Row 2</td> </tr> <tr> <td>Data in Column 1, Row 3</td> <td>Data in Column 2, Row 3</td> <td>Data in Column 3, Row 3</td> </tr> <tr> <td>Data in Column 1, Row 4</td> <td>Data in Column 2, Row 4</td> <td>Data in Column 3, Row 4</td> </tr> </table> </body> </html>In this HTML5 Document example, we have created a table using the <table> tag that has 3 columns and 4 rows. Row 1 of the table is defined using the first <tr> tag. It has 3 table heading cells defined using the <th> tag. Rows 2 - 4 of the table use the <td> tag to define standard table cells.
HTML 4.01 Transitional Document
If you created a new web page in HTML 4.01 Transitional, your <table> tag might look like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>HTML 4.01 Transitional Example by www.techonthenet.com</title> </head> <body> <table> <tr> <th>Column 1 Heading</th> <th>Column 2 Heading</th> <th>Column 3 Heading</th> </tr> <tr> <td>Data in Column 1, Row 2</td> <td>Data in Column 2, Row 2</td> <td>Data in Column 3, Row 2</td> </tr> <tr> <td>Data in Column 1, Row 3</td> <td>Data in Column 2, Row 3</td> <td>Data in Column 3, Row 3</td> </tr> <tr> <td>Data in Column 1, Row 4</td> <td>Data in Column 2, Row 4</td> <td>Data in Column 3, Row 4</td> </tr> </table> </body> </html>In this HTML 4.01 Transitional Document example, we have created a table using the <table> tag that has 3 columns and 4 rows. Row 1 of the table is defined using the first <tr> tag. It has 3 table heading cells defined using the <th> tag. Rows 2 - 4 of the table use the <td> tag to define standard table cells.
XHTML 1.0 Transitional Document
If you created a new web page in XHTML 1.0 Transitional, your <table> tag might look like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>XHMTL 1.0 Transitional Example by www.techonthenet.com</title> </head> <body> <table> <tr> <th>Column 1 Heading</th> <th>Column 2 Heading</th> <th>Column 3 Heading</th> </tr> <tr> <td>Data in Column 1, Row 2</td> <td>Data in Column 2, Row 2</td> <td>Data in Column 3, Row 2</td> </tr> <tr> <td>Data in Column 1, Row 3</td> <td>Data in Column 2, Row 3</td> <td>Data in Column 3, Row 3</td> </tr> <tr> <td>Data in Column 1, Row 4</td> <td>Data in Column 2, Row 4</td> <td>Data in Column 3, Row 4</td> </tr> </table> </body> </html>In this XHTML 1.0 Transitional Document example, we have created a table using the <table> tag that has 3 columns and 4 rows. Row 1 of the table is defined using the first <tr> tag. It has 3 table heading cells defined using the <th> tag. Rows 2 - 4 of the table use the <td> tag to define standard table cells.
XHTML 1.0 Strict Document
If you created a new web page in XHTML 1.0 Strict, your <table> tag might look like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>XHTML 1.0 Strict Example by www.techonthenet.com</title> </head> <body> <table> <tr> <th>Column 1 Heading</th> <th>Column 2 Heading</th> <th>Column 3 Heading</th> </tr> <tr> <td>Data in Column 1, Row 2</td> <td>Data in Column 2, Row 2</td> <td>Data in Column 3, Row 2</td> </tr> <tr> <td>Data in Column 1, Row 3</td> <td>Data in Column 2, Row 3</td> <td>Data in Column 3, Row 3</td> </tr> <tr> <td>Data in Column 1, Row 4</td> <td>Data in Column 2, Row 4</td> <td>Data in Column 3, Row 4</td> </tr> </table> </body> </html>In this XHTML 1.0 Strict Document example, we have created a table using the <table> tag that has 3 columns and 4 rows. Row 1 of the table is defined using the first <tr> tag. It has 3 table heading cells defined using the <th> tag. Rows 2 - 4 of the table use the <td> tag to define standard table cells.
XHTML 1.1 Document
If you created a new web page in XHTML 1.1, your <table> tag might look like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>XHTML 1.1 Example by www.techonthenet.com</title> </head> <body> <table> <tr> <th>Column 1 Heading</th> <th>Column 2 Heading</th> <th>Column 3 Heading</th> </tr> <tr> <td>Data in Column 1, Row 2</td> <td>Data in Column 2, Row 2</td> <td>Data in Column 3, Row 2</td> </tr> <tr> <td>Data in Column 1, Row 3</td> <td>Data in Column 2, Row 3</td> <td>Data in Column 3, Row 3</td> </tr> <tr> <td>Data in Column 1, Row 4</td> <td>Data in Column 2, Row 4</td> <td>Data in Column 3, Row 4</td> </tr> </table> </body> </html>In this XHTML 1.1 Document example, we have created a table using the <table> tag that has 3 columns and 4 rows. Row 1 of the table is defined using the first <tr> tag. It has 3 table heading cells defined using the <th> tag. Rows 2 - 4 of the table use the <td> tag to define standard table cells.
NEXT: <tr>
Share on: Databases
- SQL
- Oracle / PLSQL
- SQL Server
- MySQL
- MariaDB
- PostgreSQL
- SQLite
MS Office
- Excel
- Access
- Word
Web Development
- HTML
- CSS
- JavaScript
- Color Picker
Programming
- C Language
More
- ASCII
- Unicode
- Linux
- UNIX
- Techie Humor

HTML Elements
- <!DOCTYPE>
- <a>
- <abbr>
- <address>
- <area>
- <article>
- <aside>
- <b>
- <base>
- <blockquote>
- <body>
- <br>
- <button>
- <canvas>
- <caption>
- <cite>
- <code>
- <col>
- <colgroup>
- <datalist>
- <dd>
- <del>
- <dfn>
- <div>
- <dl>
- <dt>
- <em>
- <embed>
- <fieldset>
- <footer>
- <form>
- <h1>
- <h2>
- <h3>
- <h4>
- <h5>
- <h6>
- <head>
- <header>
- <hr>
- <html>
- <i>
- <iframe>
- <img>
- <input>
- <ins>
- <kbd>
- <label>
- <legend>
- <li>
- <link>
- <main>
- <map>
- <mark>
- <marquee>
- <menu>
- <meta>
- <nav>
- <noscript>
- <object>
- <ol>
- <optgroup>
- <option>
- <p>
- <pre>
- <q>
- <s>
- <script>
- <section>
- <select>
- <small>
- <span>
- <strong>
- <style>
- <sub>
- <sup>
- <table>
- <tbody>
- <td>
- <tfoot>
- <th>
- <thead>
- <time>
- <title>
- <tr>
- <u>
- <ul>

Deprecated HTML Elements
- <acronym>
- <basefont>
- <big>
- <center>
- <font>
- <strike>
Home | About Us | Contact Us | Testimonials | Donate
While using this site, you agree to have read and accepted our Terms of Service and Privacy Policy.
Copyright © 2003-2026 TechOnTheNet.com. All rights reserved.
Từ khóa » Html Table Td Alt Text
-
Display An Alternate Text On Mouseover For A Table Entry
-
HTML Alt Attribute - W3Schools
-
HTML5: Techniques For Providing Useful Text Alternatives
-
Alt Text On Table Cell - Javascript - Bytes Developer Community
-
Learn How Does Alt Tag Work In HTML With Examples - EduCBA
-
2 Adding Alt Text To Images & Tables | Digital Services Georgia
-
The Table Element - HTML: HyperText Markup Language | MDN
-
5 Ways To Improve Table Accessibility - Rachele DiTullio
-
Tables Tutorial | Web Accessibility Initiative (WAI) - W3C
-
Tables | Accessible U
-
Image ALT Tag Tips For HTML - Accessibility At Penn State
-
Examination Of Alt Text Guidance In The HTML5 Draft
-
HTML And CSS Tutorial - Nanyang Technological University
-
Some Things About `alt` Text | CSS-Tricks
Liên Hệ
TRUYỀN HÌNH CÁP SÔNG THU ĐÀ NẴNG
Địa Chỉ: 58 Hàm Nghi - Đà Nẵng
Phone: 0905 989 xxx
Facebook: https://fb.com/truyenhinhcapsongthu/
Twitter: @ Capsongthu
Copyright © 2022 | Thiết Kế Truyền Hình Cáp Sông Thu
HTML: