The Wayback Machine - https://web.archive.org/web/20240830113452/https://www.geeksforgeeks.org/pure-css-table-with-horizontal-borders/
Open In App

Pure CSS Table with Horizontal Borders

Last Updated : 30 Jan, 2022
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

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. In Pure CSS, we will add a “pure-table” class to add styles to the table. This class adds padding and borders to table elements and emphasizes the header.

A table with Horizontal Borders is a table that has only a horizontal border. To make the horizontal bordered table, we will add the “pure-table-horizontal” class.

Pure CSS Table with Horizontal Borders Class:

  • pure-table-horizontal: This class is used to create the horizontal bordered table. This class is used with a pure-table class.

Syntax:

<table class="pure-table pure-table-horizontal">
    <thead>
         // Table heading content
    </thead>
    <tbody>
         // Table body content
    </tbody>
</table>

Example:

HTML




<!DOCTYPE html>
<html>
  
<head>
    <link rel="stylesheet" 
          href=
          integrity=
"sha384-Uu6IeWbM+gzNVXJcM9XV3SohHtmWE+3VGi496jvgX1jyvDTXfdK+rfZc8C1Aehk5"
          crossorigin="anonymous">
</head>
  
<body>
    <center>
        <h1 style="color: green;">
            GeeksforGeeks
        </h1>
  
        <h3>Pure CSS Table with Horizontal Borders</h3>
  
        <table class="pure-table pure-table-horizontal">
            <thead>
                <tr>
                    <th>Rank</th>
                    <th>Name</th>
                    <th>Runs</th>
                    <th>Centuries</th>
                    <th>Strike Rate</th>
                    <th>Avg</th>
                </tr>
            </thead>
  
            <tbody>
                <tr>
                    <td>1</td>
                    <td>Rohit</td>
                    <td>10000</td>
                    <td>29</td>
                    <td>97</td>
                    <td>55</td>
                </tr>
  
                <tr>
                    <td>2</td>
                    <td>Virat</td>
                    <td>12000</td>
                    <td>40</td>
                    <td>91</td>
                    <td>49</td>
                </tr>
  
                <tr>
                    <td>3</td>
                    <td>Rahul</td>
                    <td>5000</td>
                    <td>8</td>
                    <td>85</td>
                    <td>45</td>
                </tr>
  
                <tr>
                    <td>4</td>
                    <td>Rishabh</td>
                    <td>4000</td>
                    <td>2</td>
                    <td>89</td>
                    <td>39</td>
                </tr>
            </tbody>
        </table>
    </center>
</body>
  
</html>


Output:

Pure CSS Table with Horizontal Borders

Pure CSS Table with Horizontal Borders



Previous Article
Next Article

Similar Reads

Pure CSS applying Padding and Borders to Grid Units
Pure CSS is a free and open-source CSS framework. It is a set of instruments for developing responsive websites and online applications. This was created by Yahoo and is used to create websites that are quicker, more aesthetically beautiful, and more user-friendly. It effectively replaces Bootstrap. The responsive design was considered when creatin
3 min read
Pure CSS Horizontal Menu
We come across horizontal menus on almost every website. Pure CSS helps us implement such menus with ease by using the pure-menu class. Pure-menu class by default creates a vertical menu which we can simply convert into a horizontal one by adding the class pure-menu-horizontal. One of the most common uses of a horizontal menu is in navigation bars
2 min read
Design a Vertical and Horizontal menu using Pure CSS
Menu is a very important component in any website. It is a user interface element within a webpage that contains links to other sections of the website. It can be displayed horizontally or vertically before the main content of the webpage or header. For Creating Vertical Menu: Menus are vertical by default in Pure CSS. It is easy to customize becau
2 min read
Pure CSS Responsive Horizontal-to-Vertical Menu Layout
To create a responsive horizontal-to-vertical menu layout using only CSS, you can use media queries to apply different styles to the menu based on the width of the viewport. Example 1: This will create a horizontal menu with evenly distributed menu items on larger screens, and a vertical menu with full-width menu items on smaller screens. You can a
3 min read
Pure CSS Responsive Horizontal-to-Scrollable Menu Layout
A Horizontal-to-Scrollable menu is a type of responsive menu bar in Pure.CSS, which changes the horizontal menu bar to a horizontally scrollable menu bar. It is used to make the menu bar responsive when the width of the website increases or decreases from device to device, For example, Tablets, Smartphones, etc. The Pure.CSS Horizontal-to-Scrollabl
4 min read
Pure CSS Scrollable Horizontal Menu
When there isn't enough room, the scrollable horizontal menu items can be used. It gives responsiveness to the web pages. To create a scrollable horizontal menu, add the pure-menu-scrollable class. Pure.CSS provides vertical menus by default. You can change the vertical menu to a horizontal menu by adding the class name pure-menu-horizontal dropdow
3 min read
How to set the collapsing borders model for a table ?
CSS describes the way HTML elements should be displayed. There are various CSS properties that can add magic to the basic HTML document. This article is focused on setting the collapsing borders model for the table element of HTML. HTML tables allow us to arrange our data using rows and columns. The &lt;table&gt; tag defines an HTML table. Each tab
3 min read
Bootstrap 5 Table borders
Bootstrap 5 Table borders classes are used to set or unset the border of the table. With bootstrap 5 table borders are easy to customize with border or no border. Bordered tables: This is used to set the border on each side of the table.Tables without borders: This is used to make the table borderless all over the table like there will be no row an
2 min read
HTML Table Borders
HTML Table Borders define the visible lines around cells and the overall table. They help in creating clear distinctions between various sections of the table, making it easier to understand and show information clearly. This attribute allows you to control the border's style, color, and width, for the visual presentation of your table. Syntaxtable
5 min read
Pure CSS Bordered Table
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. In Pure CSS, we will add "pure-table" class to add styles on table. This class adds the padding and borders to table elements, and emphasizes the header. Bordered Table is a table that h
1 min read
Pure CSS Stripped Table
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. In Pure CSS, we will add a "pure-table" class to add styles to the table. This class adds padding and borders to table elements and emphasizes the header. Pure CSS Stripped Table Class
2 min read
Tailwind CSS Borders Complete Reference
Tailwind CSS is a highly customizable, low-level CSS framework that gives you all of the buildings blocks that you need. Tailwind CSS Border utility settings the radius, width, color, opacity, etc., of element's borders. all the properties covered as in this class form. Tailwind CSS Class Description Example Border RadiusIt is used to set the borde
2 min read
Primer CSS Responsive Borders
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, an
3 min read
Primer CSS Borders
Primer CSS is a free and open-source CSS framework. It is built upon the systems that create the foundation of the basic style elements such as spacing, typography, and color. Created with GitHub’s design system, it is highly reusable and flexible. Primer CSS Borders is a utility class that applies borders to a div container of HTML by simply apply
3 min read
How to add Borders and Shadows to Elements in CSS ?
Apply box shadows to elements to create a 3D effect, whereas adding borders to containers or boxes can enhance the structural clarity of a layout. In this article, we will learn how to add borders and shadows to the elements in CSS. We will explore two different approaches to adding borders and shadows. Table of Content Using the border and box-sha
2 min read
How to Add Borders to Pagination in CSS ?
Add borders to Pagination is when you have many pages of content and must move between them. Making these page buttons look better can make navigating easier and more enjoyable for users. One way to do this is by adding borders to the page buttons using CSS. These are the following approaches: Table of ContentUsing Border PropertyUsing Border-Style
3 min read
CSS Borders
A CSS border is a line that surrounds an HTML element, providing a visual separation between the element and its surroundings. Borders can be styled in various ways, including adjusting their width, color, and style. The basic properties used to define borders in CSS are border-width, border-style, and border-color. This Borders in CSS article will
6 min read
How to remove borders of a canvas-type text using Fabric.js ?
In this article, we are going to see how to remove the borders of a canvas-like text using FabricJS. The canvas means text written is movable and can be stretched according to requirement. Further, the text itself cannot be edited like a textbox.Approach: To make it possible we are going to use a JavaScript library called FabricJS. After importing
2 min read
Borders in bootstrap with examples
Borders: Borders are generally used to display an outline around a box or table cell or any other HTML element. In Bootstrap, there are different classes available to add or remove borders. The classes that are used to add borders are referred as Additive classes and those that are used to remove borders are referred as subtractive classes. Additiv
4 min read
How to remove controlling borders of a canvas circle using Fabric.js ?
In this article, we are going to see how to remove the controlling borders of a canvas circle using FabricJS. The canvas means the circle is movable and can be stretched according to requirement. Further, the circle can be customized when it comes to initial stroke color, fill color, stroke width, or radius. Approach: To make it possible, we are go
2 min read
How to change Input box borders after filling the box using JavaScript ?
In this article, we will change the input border after filling in the text on the input text field. The onchange event attribute works when the value of the element changes and selects the new value from the list. Approach: Whenever the input value is changed with some value by the user, the onchange event attribute is triggered. After the event is
2 min read
React MUI Borders
Material UI is an open-source design framework that showcases different components made in react. It is developed and maintained by Google since 2014. What is Borders API offered by Material UI? The Borders API, provided by MUI, allows us to control the border and border-radius of DOM elements that have border utilities. passed to Borders API props
3 min read
Tachyons Theming Borders
CSS border properties allow us to set the style, color, and width of the border. Tachyon is a toolkit that is used to create a responsive website. Used Classes: Border: The "ba" class is used to create a simple border.Border Top: The "bt" class is used to create a border from the top.Border Right: The "br" class is used to create a border from the
4 min read
Bootstrap 5 Borders Sizes
Bootstrap 5 Border utility is used to set the style of the border element. The border styles can be of border-color, border-width, border-radius, etc. The Border Sizes are used to set the border-radius rounded corners larger or smaller. The range of border sizes varies from 0 to 3, where 0 represents smaller-size rounded corners and 3 represents la
2 min read
Bootstrap 5 Borders Subtractive
Bootstrap5 Borders Subtractive is used to remove borders from the box by defining which side the border is to be removed or we can remove the border from all sides at once. Bootstrap 5 Borders Subtractive Classes: border-0: This class is used to remove borders from all around the elementborder-top-0: This class is used to remove the border from the
3 min read
Bootstrap 5 Borders Additive
Bootstrap5 Borders Additive classes are mainly used to display an outline around a box and it provides style, color, and radius of an element border on the side we want. For eg: if we want the border only on the top of the box we can have it by using the border-top additive class. Bootstrap 5 Borders Additive classes: border: This class is used to
2 min read
Bootstrap 5 Tables without borders
Bootstrap5 Tables without borders is used to create a table in borderless form. It is mostly used when we do not want to show the separation in the table content. Tables without Borders Class: table-borderless: This class is used to create borderless tables Syntax: &lt;table class="table table-borderless"&gt; ... &lt;/table&gt; Example 1: In this e
2 min read
Chakra UI Borders
Chakra UI is a popular React component library that simplifies the process of building user interfaces with a set of customizable and accessible components. Among those feature it also provide support for styling and layout including the management of borders. It provides various properties to customize borders. In this article, we will learn about
2 min read
Gradient borders
Creating visually appealing borders can significantly enhance the user experience on your website. One such technique is the use of gradient borders. Although CSS does not directly support gradient borders, there are two effective methods to achieve this: Try It: .custom-item { border: 1px solid gray; font-family: 'Gill Sans', 'Gill Sans MT', Calib
3 min read
Bootstrap 5 Borders
Bootstrap 5 Borders offer predefined border styles to elements. Classes like .border, .border-0, .border-top, .border-bottom, .border-left, and .border-right provide easy customization for borders, including color, width, and radius, enhancing UI design. iframe { width: 100%; height: 450px;} @media (max-width: 1145px) {.article--viewer .a-wrapper .
2 min read
Article Tags :