Html-col-tag

提供:Dev Guides
移動先:案内検索

HTML-<col>タグ

説明

HTML <col>タグを使用すると、作成者はテーブル列の属性仕様をグループ化できます。 列を構造的にグループ化しません。これが<colgroup>要素の役割です。

The

<!DOCTYPE html>
<html>

   <head>
      <title>HTML col Tag</title>
   </head>

   <body>
      <p>This example shows a colgroup that has three columns of different widths:</p>
      <table border = "1">
         <colgroup span = "3">
            <col width = "50"></col>
            <col width = "100"></col>
            <col width = "150"></col>
            <col width = "50"></col>
         </colgroup>

         <tr>
            <td>col 1</td>
            <td>col 2</td>
            <td>col 3</td>
            <td>col 4</td>
         </tr>
      </table>
   </body>

</html>

これは、次の結果を生成します-

グローバル属性

このタグは、リンク:/html/html_attributes_reference [* HTML属性リファレンス*]で説明されているすべてのグローバル属性をサポートします

特定の属性

HTML <col>タグは、次の追加属性もサポートしています-

Attribute Value Description
align right left center justify char Defines horizontal alignment, not supported in Html5.
char character Defines a character to use to align text on (use with align = "char"), not supported in Html5.
charoff pixel Specifies an alignment offset (either in pixels or percentage value) against the first character as specified with the char attribute, not supported in Html5.
span number Defines the number of columns the <col> should span, not supported in Html5.
valign bottom middle top baseline Defines vertical alignment, not supported in Html5.
width pixels or % Specifies a default width for each column spanned by the current col element, not supported in Html5 .

イベント属性

このタグは、link:/html/html_events_reference [HTMLイベントリファレンス]で説明されているすべてのイベント属性をサポートしています。

ブラウザのサポート

Chrome Firefox IE Opera Safari Android
Yes Yes Yes Yes Yes ?