Open In App

Semantic-UI Table Basic Variation

Improve
Improve
Like Article
Like
Save
Share
Report

Semantic UI is an open-source framework that uses CSS and jQuery to build great user interfaces. It is the same as a bootstrap for use and has great different elements to use to make your website look more amazing. It uses a class to add CSS to the elements.

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 Semantic UI table both are the same structurally.

The basic variation is used to reduce the complexity and to increase readability.

Semantic UI Table Basic Variation Classes:

  • basic: This class is used to reduce the complexity of our table.

Syntax:

<table class="ui basic table">
    <tr>
        <td></td>
        ...
    </tr>
    ...
</table>

Example 1: This is a basic example illustrating the difference between a normal table and table basic variation created using Semantic UI.

HTML




<!DOCTYPE html>
<html>
<head>
    <title>Semantic-UI Table Basic Variation</title>
    <link href=
          rel="stylesheet" />       
</head>
<body>
    <center>
        <h1 class="ui green header">GeeksforGeeks</h1>
        <strong>Semantic-UI Table Basic Variation</strong>
    </center>
     
   <b>Normal table</b>
    <table class="ui table">
        <thead>
            <tr>
                <th>Data Structures</th>
                <th>Access</th>
                <th>Insertion</th>
                <th>Deletion</th>
                <th>Search</th>
            </tr>
        </thead>
        <tbody>
          <tr>
            <td>Array</td>
            <td>O(1)</td>
            <td>O(n)</td>
            <td>O(n)</td>
            <td>O(n)</td>
          </tr>
          <tr>
            <td>LinkedList</td>
            <td>O(n)</td>
            <td>O(1)</td>
            <td>O(1)</td>
            <td>O(n)</td>
          </tr>
          <tr>
            <td>HashMap</td>
            <td>N/A</td>
            <td>O(1)</td>
            <td>O(1)</td>
            <td>O(1)</td>
          </tr>
      </tbody>
    </table>
    <b>Basic Table</b>
    <table class="ui basic table">
        <thead>
            <tr>
                <th>Data Structures</th>
                <th>Access</th>
                <th>Insertion</th>
                <th>Deletion</th>
                <th>Search</th>
            </tr>
        </thead>
        <tbody>
          <tr>
            <td>Array</td>
            <td>O(1)</td>
            <td>O(n)</td>
            <td>O(n)</td>
            <td>O(n)</td>
          </tr>
          <tr>
            <td>LinkedList</td>
            <td>O(n)</td>
            <td>O(1)</td>
            <td>O(1)</td>
            <td>O(n)</td>
          </tr>
          <tr>
            <td>HashMap</td>
            <td>N/A</td>
            <td>O(1)</td>
            <td>O(1)</td>
            <td>O(1)</td>
          </tr>
      </tbody>
    </table>
</body>
</html>


Output:

Semantic-UI Table Basic Variation

Semantic-UI Table Basic Variation

Example 2: This is a basic example illustrating the difference between a basic table and a very basic table variation created using Semantic UI.

HTML




<!DOCTYPE html>
<html>
<head>
    <title>Semantic-UI Table Basic Variation</title>
    <link href=
          rel="stylesheet" />       
</head>
<body>
    <center>
        <h1 class="ui green header">GeeksforGeeks</h1>
        <strong>Semantic-UI Table Basic Variation</strong>
    </center>
    <b>Basic Table</b>
    <table class="ui basic table">
        <thead>
            <tr>
                <th>Data Structures</th>
                <th>Access</th>
                <th>Insertion</th>
                <th>Deletion</th>
                <th>Search</th>
            </tr>
        </thead>
        <tbody>
          <tr>
            <td>Array</td>
            <td>O(1)</td>
            <td>O(n)</td>
            <td>O(n)</td>
            <td>O(n)</td>
          </tr>
          <tr>
            <td>LinkedList</td>
            <td>O(n)</td>
            <td>O(1)</td>
            <td>O(1)</td>
            <td>O(n)</td>
          </tr>
          <tr>
            <td>HashMap</td>
            <td>N/A</td>
            <td>O(1)</td>
            <td>O(1)</td>
            <td>O(1)</td>
          </tr>
      </tbody>
    </table>
    <b>Very Basic Table</b> <br><br>
    <table class="ui very basic table">
        <thead>
            <tr>
                <th>Data Structures</th>
                <th>Access</th>
                <th>Insertion</th>
                <th>Deletion</th>
                <th>Search</th>
            </tr>
        </thead>
        <tbody>
          <tr>
            <td>Array</td>
            <td>O(1)</td>
            <td>O(n)</td>
            <td>O(n)</td>
            <td>O(n)</td>
          </tr>
          <tr>
            <td>LinkedList</td>
            <td>O(n)</td>
            <td>O(1)</td>
            <td>O(1)</td>
            <td>O(n)</td>
          </tr>
          <tr>
            <td>HashMap</td>
            <td>N/A</td>
            <td>O(1)</td>
            <td>O(1)</td>
            <td>O(1)</td>
          </tr>
      </tbody>
    </table>
</body>
</html>


Output:

Semantic-UI Table Basic Variation

Semantic-UI Table Basic Variation

Reference: https://semantic-ui.com/collections/table.html#basic



Last Updated : 17 Mar, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads