table(表格)中的标签和属性

 1、表格由 <table> 标签来定义。行( <tr> ),单元格(<td> )

字母 td 指表格数据(table data),即数据单元格的内容。数据单元格可以包含文本、图片、列表、段
落、表单、水平线、表格,<table border="1">:显示表格边框,表格的表头使用 <th> 定义,有加粗的作用。

 2、<table> 定义表格

    • <caption> 定义表格标题。居中
    • <th> 定义表格的表头。
    • <tr> 定义表格的行。
    • <td> 定义表格单元。
    • <thead> 定义表格的页眉。
    • <tbody> 定义表格的主体。
    • <tfoot> 定义表格的页脚。
    • <col> 定义用于表格列的属性。
    • <colgroup> 定义表格列的组。

 2、align ://对齐方式

    •     right
    •     left
    •     center
    •     justify
    •     char

    定义在列组合中内容的水平对齐方式。

 3、Valign:

    •   top
    •   middle
    •   bottom
    •   baseline

    定义在列组合中内容的垂直对齐方式

实例:

1 .tab_v td{
2 
3 border: 1px dashed red;
4 vertical-align: top;
5 }

 注:top ,bottom ,middle默认,只争对表格,对于文本必须和display:table-cell 才有居中的效果

原文地址:https://www.cnblogs.com/hlrblog/p/7979178.html