HTML <tr>标签用于指定表中的表行。
<!DOCTYPE html> <html> <head> <title>HTML tr Tag</title> </head> <body> <table border="1"> <tr> <th>Cricketers</th> <th>Ranking</th> </tr> <tr> <td>M.S Dhoni</td> <td>1</td> </tr> <tr> <td>Yuvraj Singh</td> <td>2</td> </tr> <tr> <td>Virat Kohli</td> <td>3</td> </tr> </table> </body> </html>
这将产生以下结果-
此标签支持- HTML属性参考中所述的所有全局属性。
HTML <tr>标签还支持以下附加属性-
Attribute | Value | 描述 |
---|---|---|
align | right left center justify char |
不推荐使用-外观对齐。 |
bgcolor | rgb(x,x,x) #hexcode colorname |
不推荐使用-指定表格单元格的背景色。 |
char | character | 不推荐使用-指定要在其上对齐文本的字符。在align =“ char”时使用。 |
charoff | pixels or % | 不推荐使用-使用char属性指定相对于第一个字符的对齐偏移量。在align =“ char”时使用。 |
valign | top middle bottom baseline |
不推荐使用-垂直对齐。 |
此标签支持- HTML事件参考中所述的所有事件属性。
Chrome | Firefox | IE | Opera | Safari | Android |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)