Open In App

HTML | <table> rules Attribute

Last Updated : 27 Mar, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The HTML <table> rules Attribute is used to specify which parts of the inside borders that should be visible

Syntax:

<table rules="value">

Attribute Values:

  • none: It does not create any lines.
  • groups: It create lines between row and column groups.
  • rows: It creates line between the rows.
  • cols: It creates line between the columns.
  • all: It creates line between the rows and columns.

Note: The <table> rules Attribute is not supported by HTML 5. 

Example: 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML table rules Attribute
    </title>
</head>
 
<body>
    <h1>GeeksforGeeks</h1>
 
    <h2>HTML table rules Attribute</h2>
 
    <table rules="rows">
        <tr>
            <th>NAME</th>
            <th>AGE</th>
            <th>BRANCH</th>
        </tr>
        <tr>
            <td>BITTU</td>
            <td>22</td>
            <td>CSE</td>
        </tr>
    </table>
    <br>
    <table rules="cols">
        <tr>
            <th>NAME</th>
            <th>AGE</th>
            <th>BRANCH</th>
        </tr>
        <tr>
            <td>BITTU</td>
            <td>22</td>
            <td>CSE</td>
        </tr>
    </table>
    <br>
    <table rules="all">
        <tr>
            <th>NAME</th>
            <th>AGE</th>
            <th>BRANCH</th>
        </tr>
        <tr>
            <td>BITTU</td>
            <td>22</td>
            <td>CSE</td>
        </tr>
    </table>
</body>
 
</html>


Output:

  

Supported Browsers: The browser supported by HTML <table> rules Attribute are listed below:

  • Google Chrome
  • Internet Explorer 9.0
  • Firefox
  • Safari
  • Opera


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads