Skip to content
Related Articles

Related Articles

Foundation CSS Tables Stripes

View Discussion
Improve Article
Save Article
  • Last Updated : 10 Mar, 2022
View Discussion
Improve Article
Save Article

Foundation CSS is an open-source and responsive front-end framework built by ZURB foundation in September 2011, that makes it easy to design beautiful responsive websites, apps, and emails that look amazing and can be accessible to any device. It is used by many companies such as Facebook, eBay, Mozilla, Adobe, and even Disney. The framework is built on Saas-like bootstrap. It is more sophisticated, flexible, and easily customizable. It also comes with CLI, so it’s easy to use it with module bundlers. It offers the Fastclick.js tool for faster rendering on mobile devices. 

Tables are an easy way to organize a lot of data. A table is an arrangement of data in rows and columns, or possibly in a more complex structure. Tables are widely used in communication, research, and data analysis. Tables are useful for various tasks such as presenting text information and numerical data. It can be used to compare two or more items in the tabular form layout. 

Tables are used to create databases. An HTML table and a Foundation CSS table both are the same structurally. Tables stripes mean that the rows in the table have alternate white and grey background colors which appear like stripes. 

Foundation CSS Tables Classes:

  • striped: This class helps to enable stripe styling of our table which is by default present in a Foundation CSS table.
  • unstriped: This class helps to remove the stripe styling of our table which is thereby present in a Foundation CSS table.

Syntax:

<table class="striped">
    <thead>
        ...
    </thead>
    <tbody>
        ...
    </tbody>
</table>

Note:

  • Always the <thead> element must have at least one <tr> element.
  • Though structurally the tables of both HTML and Foundation CSS are the same, there is some styling applied to the table in Foundation CSS.
  • Foundation CSS tables have responsive modifiers to help solve some of the layout issues based on your table’s needs.

Example 1: This is a basic example illustrating tables with striped classes using Foundation CSS.

HTML




<!DOCTYPE html>
<html lang="en">
<head>
    <title>Foundation CSS Tables Stripes</title>
   <!-- Compressed CSS -->
    <link rel="stylesheet"
          href=
</head>
<body>
  <center>
    <h1 style="color:green;">GeeksforGeeks</h1>
    <strong>Foundation CSS Tables</strong>
     <br/><br/>
    <table style="width:90%" class="striped">
      <tr>
        <th>Student Name</th>
        <th>Branch</th>
        <th>RollNo</th>
      </tr>
      <tr>
        <td>Ravi</td>
        <td>CSE</td>
        <td>001</td>
      </tr>
      <tr>
        <td>Naveen</td>
        <td>CSE</td>
        <td>002</td>
      </tr>
      <tr>
        <td>Srihita</td>
        <td>ECE</td>
        <td>003</td>
      </tr>
      <tr>
        <td>Aman</td>
        <td>MECH</td>
        <td>004</td>
      </tr>
    </table>
  </center>
</body>
</html>

Output:

Foundation CSS Tables Stripes

Foundation CSS Tables Stripes

Example 2: This is a basic example illustrating an unstriped table using an unstriped class using Foundation CSS.

HTML




<!DOCTYPE html>
<html lang="en">
<head>
    <title>Foundation CSS Tables Stripes</title>
    <!-- Compressed CSS -->
   <link rel="stylesheet"
         href=
</head>
<body>
  <center>
    <h1 style="color:green;">GeeksforGeeks</h1>
    <strong>Foundation CSS Tables</strong>
    <br/><br/>
    <table style="width:90%" class="unstriped">
      <tr>
        <th>Student Name</th>
        <th>Branch</th>
        <th>RollNo</th>
      </tr>
      <tr>
        <td>Ravi</td>
        <td>CSE</td>
        <td>001</td>
      </tr>
      <tr>
        <td>Naveen</td>
        <td>CSE</td>
        <td>002</td>
      </tr>
      <tr>
        <td>Srihita</td>
        <td>ECE</td>
        <td>003</td>
      </tr>
      <tr>
        <td>Aman</td>
        <td>MECH</td>
        <td>004</td>
      </tr>
    </table>
  </center>
</body>
</html>

Output:

Foundation CSS Tables Stripes

Foundation CSS Tables Stripes

Reference: https://get.foundation/sites/docs/table.html


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!