HTML <table> Tag« Previous Complete HTML Reference Next » Example A simple HTML table, containing two columns and two rows: <table> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> Try it yourself » ...
The<table>tag also supports theEvent Attributes in HTML. More Examples Example How to add collapsed borders to a table (with CSS): <html> <head> <style> table, th, td{ border:1px solid black; border-collapse:collapse; } </style> ...
Table tag <table> in HTML The <table> tag is used to define a table. For example, <table> …. <table> Table Row <tr> in HTML The <tr> tag is used to define a row in a table. For example, <table> <tr> ... </tr> </table> The table row can include either table heading...
Example table, th, td { border: 1px solid black; border-collapse: collapse;}th, td { padding: 15px;} Try it Yourself » HTML Table HeadingsTable headings are defined with the <th> tag.By default, all major browsers display table headings as bold and centered:...
However, you can use CSS to style the <article> element (see example below).Browser SupportThe numbers in the table specify the first browser version that fully supports the element.Element <article> 6.0 9.0 4.0 5.0 11.1Global AttributesThe <article> tag also supports the Global Attributes in...
On more complex tables, you may want to add the<th>scopeattributeto provide better information for assistive technologies such as screen readers to understand your table. An example where it may be needed is where you have table headings along the top and down the table’s first column. ...
Applies toollists. Specifies the item’s value. The following list items will increment from that number. Example:<ol> <li value="7">Apple</li> </ol> #Tables #<table>Tag A table. <table><thead><tr><th>Company</th><th>Country</th></tr></thead><tbody><tr><td>Alfreds Futterki...
To make a cell span more than one column, you can use the colspan attribute. Simply add it to the opening tag of the table header (or a table cell) and set it to the number of columns you want it to span. For the example below, let’s say you’d like to add both the cell ...
<table> 标签定义表格,<th> 标签定义表头,<tr> 标签定义行,<td> 定义表格单元,表格单元可以包含各种元素 常用的属性如下: border:定义表格边框宽度,单位为 pixels,如果没有显式定义,则默认不显示边框 cellpadding:规定单元格边沿与其内容之间的空白,单位为 pixels ...
<col>,<colgroup>,<table>,<tbody>,<td>,<tfoot>,<th>,<thead>,<tr>: Other table-related elements caption-side: CSS property to position the<caption>relative to its parent<table> text-align: CSS property to horizontally align the text content of the<caption>...