首页 > 代码库 > HTML table元素
HTML table元素
搬运,内容来自HTML Dog.
简单示例
<!DOCTYPE html><html> <body> <table> <tr> <td>Row 1, cell 1</td> <td>Row 1, cell 2</td> <td>Row 1, cell 3</td> </tr> <tr> <td>Row 2, cell 1</td> <td>Row 2, cell 2</td> <td>Row 2, cell 3</td> </tr> <tr> <td>Row 3, cell 1</td> <td>Row 3, cell 2</td> <td>Row 3, cell 3</td> </tr> <tr> <td>Row 4, cell 1</td> <td>Row 4, cell 2</td> <td>Row 4, cell 3</td> </tr> </table> </body></html>
The table element defines the table.The tr element defines a table row.The td element defines a data cell. These must be enclosed in tr tags, as shown above.
tr=table row=行
td=table date cell=列元素
示例2
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>Basic table</title> <style> td { border: 1px solid #999; padding: 0.1em 1em; } </style></head><body> <table> <tr> <td>Cats</td> <td>Dogs</td> <td>Lemurs</td> </tr> <tr> <td>Tiger</td> <td>Grey Wolf</td> <td>Indri</td> </tr> <tr> <td>Cheetah</td> <td>Cape hunting dog</td> <td>Sifaka</td> </tr> <tr> <td>Caracal</td> <td>Red fox</td> <td>Brown lemur</td> </tr> <tr> <td>Wildcat</td> <td>Fennec</td> <td>Dwarf lemur</td> </tr> </table> <!-- Link back to HTML Dog: --> <p><a href="http://www.htmldog.com/examples/"><img src="http://www.htmldog.com/badge1.gif" alt="HTML Dog"></a></p></body></html>
HTML table元素
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。