Skip to content
Related Articles

Related Articles

Primer CSS Tables

View Discussion
Improve Article
Save Article
  • Last Updated : 25 Apr, 2022
View Discussion
Improve Article
Save Article

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:

  • <table>: This tag is used to create the table.
  • <thead>: This tag is used to create the table header.
  • <tfoot>: This tag is used to create the table footer.
  • <tr>: This tag is used to create the table row.
  • <tbody>: This tag is used to create the table body.

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.

HTML




<!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.

HTML




<!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


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!