Tailwind CSS - 表格



Tailwind CSS 表格包括**邊框摺疊、邊框間距、表格佈局**和**標題位置**。這些是 Tailwind 表格的重要概念,要設計表格,必須學習這些概念。

Tailwind CSS 表格參考

下面提到的主題可用於在 Tailwind 中設計表格。

主題 描述 示例
Tailwind CSS - 邊框摺疊 用於控制表格邊框是摺疊還是分開。
Tailwind CSS - 邊框間距 用於控制邊框之間的間距。
Tailwind CSS - 表格佈局 用於控制表格佈局演算法。
Tailwind CSS - 標題位置 用於控制表格內標題元素的對齊方式。

Tailwind CSS 表格示例

下面的示例將說明 Tailwind CSS。我們將使用它來檢視給定程式碼中每個提到的主題的影響。

示例

<!DOCTYPE html>

<head>
    <script src="https://cdn.tailwindcss.com"></script>
</head>

<body class="p-4">
    <h1 class="text-3xl mb-3"> Tailwind CSS Tables </h1>
    <table class="border-separate table-fixed w-full
                  border-spacing-x-2
                  border border-slate-500">
        <caption class="caption-top"> 
            Table Caption: Starting of Web Development 
        </caption>
        <thead>
            <tr>
                <th class="bg-green-600 border border-slate-600"> 
                    Acronym </th>
                <th class="bg-green-600 border border-slate-600"> 
                    Stand For </th>
                <th class="bg-green-600 border border-slate-600"> 
                    Description </th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class="bg-green-300 border border-slate-700"> 
                    HTML </td>
                <td class="bg-green-300 border border-slate-700"> 
                    HyperText markup Language </td>
                <td class="bg-green-300 border border-slate-700"> 
                    HTML is used to create content and structure of any web page. 
                </td>
            </tr>
            <tr>
                <td class="bg-green-300 border border-slate-700"> 
                    CSS </td>
                <td class="bg-green-300 border border-slate-700"> 
                    Cascading Style Sheets </td>
                <td class="bg-green-300 border border-slate-700"> 
                    It's a style sheet language used for describing 
                    the presentation of a document written in a markup
                    language like HTML 
                </td>
            </tr>
        </tbody>
    </table>
</body>

</html>
廣告