【前端新手之路第六天】表格與表單

表格

相關標籤:<table><tr><td><th>th是表頭單元格

<thead><tbody><tfoot>這三個與書寫順序無關,總是按照thead,tbody,tfoot順序顯示;

<colgroup><col>colgroup標籤有開始結束,一般用在table標籤中,可以用屬性span=2來表示橫跨兩行。col標籤沒有結束標籤,一般用在colgroup,table標籤中,沒有內容,爲一列定義樣式,如果沒有樣式將從colgroup中繼承。
table的一些屬性:border,width,height,cellspacing,cellpadding.此時設置的邊框有默認cellspacing,將其置零則邊框沒有間隔。
tr的一些屬性:align,valign
td的一些屬性:align,valign,width,height,rowspan,colspan
//colgroup標籤,屬性有span,align,valign(top,middle,bottom,baseline)
<table width="100%" border="1">
  <colgroup span="2" align="left"></colgroup>
  <colgroup align="right" style="color:#0000FF;"></colgroup>
  <tr>
    <th>ISBN</th>
    <th>Title</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>3476896</td>
    <td>My first HTML</td>
    <td>$53</td>
  </tr>
</table>
//col
<table width="100%" border="1">
  <col align="left" />
  <col align="left" />
  <col align="right" />
  <tr>
    <th>ISBN</th>
    <th>Title</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>3476896</td>
    <td>My first HTML</td>
    <td>$53</td>
  </tr>
</table>

表單

type類型:text,password,hidden,radio(可以通過name進行分組),button,<reset><submit><img>這三個標籤只有在form標籤中才會起作用,比如form中的reset標籤,單擊reset,表單內容重置。<input type="image" /> 定義圖像形式的提交按鈕。必須把 src 屬性 和 alt 屬性 與 <input type="image"> 結合使用。表單內各種標籤是行內元素。
form標籤不能嵌套,form中action屬性=url,當提交表單數據的時候,向何處發送表單數據。method值爲post或者get.form是塊元素。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章