首頁  >  文章  >  web前端  >  如何在HTML中包含表格列的群組?

如何在HTML中包含表格列的群組?

WBOY
WBOY轉載
2023-09-10 19:49:351358瀏覽

如何在HTML中包含表格列的群組?

使用

標記包含表格列組。 HTML 標記用於指定表內一組列的屬性。如果需要對 colgroup 中的欄位套用不同的屬性,可以在 colgroup 標籤中使用 HTML col 標記。

以下是屬性-

定義水平對齊方式,字元#字元定義用於對齊文字的字元(與align ="char"一起使用),查奧夫#像素定義

#應跨越的列數,不支援Html5number

屬性

#值

描述

對齊

右##左

#居中

對齊

char

Html5 不支援

Html5 不支援

「跨度

#定義

應跨越的列數,

在Html5 中不支援。

#########Valign###################中間###### 頂部# #####基線############定義垂直對齊方式,###Html5 不支援。 #####################寬度######像素或%######指定目前列跨越的每列的預設寬度元素,# ##在Html5 中不受支援。 ########################範例######您可以嘗試執行下列程式碼來實作HTML 中的### 標籤-###
<!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 = "4">
            <col width = "40"></col>
            <col width = "70"></col>
            <col width = "100"></col>
            <col width = "130"></col>
            <col width = "160"></col>
            </colgroup>
         <tr>
            <td>One</td>
            <td>Two</td>
            <td>Three</td>
            <td>Four</td>
            <td>Five</td>
         </tr>
      </table>
   </body>
</html>
###

以上是如何在HTML中包含表格列的群組?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:tutorialspoint.com。如有侵權,請聯絡admin@php.cn刪除