Open In App

Primer CSS Tables

Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, and BEM architecture. It is highly reusable and flexible. It is created with GitHub’s design system.

Primer CSS Tables are used to create the HTML Table using the <thead>, <tfoot>, <tbody>, and <th> tags. The <tfoot> tag is generally placed above the <tbody> tag when we want to load the footer first. In this article, we will discuss Primer CSS Tables.



Primer CSS Tables Tags:

Syntax:



<table>
      <thead>
        <tr>
              ..
        </tr>
      </thead>
      <tbody>
        <tr>
              ...
        </tr>
      </tbody>
      <tfoot>
        <tr>
              ...
        </tr>
      </tfoot>
</table>

Example 1: The following example demonstrates the Primer CSS Tables.




<!DOCTYPE html>
<html>
  
<head>
    <title> Primer CSS Tables </title>
    <link rel="stylesheet" href=
"https://unpkg.com/@primer/css@^18.0.0/dist/primer.css" />
</head>
  
<body class="m-2">
    <h1 class="color-fg-success"> GeeksforGeeks </h1>
    <h3> Primer CSS Tables </h3> <br>
  
    <table>
        <thead>
            <tr>
                <th scope="col"> Header 1 </th>
                <th scope="col"> Header 2 </th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td> John </td>
                <td> 90 </td>
            </tr>
            <tr>
                <td> Jack </td>
                <td> 75 </td>
            </tr>
        </tbody>
    </table>
</body>
  
</html>

Output:

Primer CSS Tables

Example 2: The following example demonstrates the Primer CSS Tables.




<!DOCTYPE html>
<html>
  
<head>
    <title> Primer CSS Tables </title>
    <link rel="stylesheet" href=
"https://unpkg.com/@primer/css@^18.0.0/dist/primer.css" />
</head>
  
<body class="m-2">
    <h1 class="color-fg-success"> GeeksforGeeks </h1>
    <h3> Primer CSS Tables </h3> <br>
  
    <table>
        <thead>
            <tr>
                <th scope="col"> Header 1 </th>
                <th scope="col"> Header 2 </th>
                <th scope="col"> Header 3 </th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td> <a href=""> Java </a> </td>
                <td class="color-bg-danger"> Python </td>
                <td> <a href=""> C++ </a> </td>
            </tr>
            <tr>
                <td class="color-bg-success"> App dev </td>
                <td> <a href=""> Web dev </a> </td>
                <td> <a href=""> Flutter </a> </td>
            </tr>
        </tbody>
    </table>
</body>
  
</html>

Output:

Primer CSS Tables

Reference: https://primer.style/css/principles/html#tables


Article Tags :