表格標(biāo)簽
- <table>:定義表格,表格的邊界標(biāo)簽,必定包裹表格的其他元素標(biāo)簽;
- <tr>:定義表格的行;
- <th>:定義表格的表頭,需要被<tr>包裹;
- <td>:定義表格的單元,需要被<tr>包裹;
- <thead>:定義表格的頁眉,表格分組標(biāo)簽,可將表格分割;
- <tbody>:定義表格的主體,表格分組標(biāo)簽,可將表格分割;
- <tfoot>:定義表格的頁腳,表格分組標(biāo)簽,可將表格分割;
注:如果使用thead、tfoot、tbody元素(使用順序),就必須三個(gè)同時(shí)使用。
- <tr>:定義表格標(biāo)題;
表格常用屬性
- colspan="value" 合并列;
- rowspan="value" 合并行;
- align="left/center/right" 水平對齊;
- valign="top/bottom/middle/baseline" 垂直對齊方式;
- cellpadding="value" 單元邊沿與其內(nèi)容之間的空白;
- cellspacing="value" 單元格之間的空白;
表格的css屬性
- caption-side:top/bottom/left/right; 設(shè)置表格標(biāo)題放置的位置;
- border-spacing:value; 單元格間距;
- border-collapse:separate(邊框分開)/collapse(邊框合并)
- empty-cells:show/hide; 無內(nèi)容單元格表示、隱藏;
- table-layout:auto(自動表格布局)/fixed(固定表格布局);