# Table

## Overview

The Table component is one of the most complex components in VulcanUI. It features a hierarchical structure that mirrors the actual HTML DOM. This documentation provides a comprehensive guide to all available BEM classes for styling and customizing the Table.

The Table component follows a strict hierarchical structure with the root container `ds-table__viewport` containing all sub-elements. Each level serves a specific purpose and can be styled independently.

```html
<div class="ds-table__viewport">
  <!-- All table content nested here -->
</div>
```

<figure><img src="/files/NOJp21fvo6WcDcyZ6htc" alt=""><figcaption></figcaption></figure>

## Class hierarchy

The hierarchical class structure is as follows. Modifiers are shown in parentheses.

```
 * ds-table__viewport (--sticky-footer)
 * ├── ds-table__toolbar
 * │   ├── ds-table__toolbar-actions
 * │   └── ds-table__search (--active)
 * │       ├── ds-table__search-icon
 * │       └── ds-table__search-input (--active)
 * ├── ds-table__wrapper
 * │   └── ds-table
 * │       ├── ds-table__head (--sortable --selectable --actions)
 * │       │   └── ds-table__row
 * │       │       └── ds-table__cell (--sortable --sorted-{value} --centered --right)
 * │       │           ├── ds-table__text
 * │       │           └── ds-table__cell-checkbox (--checked --disabled)
 * │       └── ds-table__body (--loading --empty --pinned)
 * │           └── ds-table__row (--selected --pinned --expanded --new)
 * │               └── ds-table__cell (--centered --right --editable --inactive)
 * │                   ├── ds-table__text
 * │                   ├── ds-table__cell-checkbox (--checked --disabled)
 * │                   └── ds-table__cell-actions (--visible)
 * │                       └── ds-table__cell-actions-button (--disabled)
 * └── ds-table__controls (--sticky)
 *     ├── ds-table__pagination
 *     ├── ds-table__pagination-button (--disabled --prev --next)
```

The following images map the Table classes by number. This helps you target the exact part you want in your custom CSS stylesheet.

## Table classes

### Outer

1. `ds-table__viewport`
2. `ds-table__toolbar`
3. `ds-table__wrapper`
4. `ds-table__controls`

<figure><img src="/files/1lJKslW1PM0lFl6m8Ejg" alt=""><figcaption></figcaption></figure>

### Toolbar

The parent class for the toolbar is `ds-table__toolbar`.

1. `ds-table__toolbar-actions`
2. `ds-table__filters`
   1. `ds-table__search`
      1. `ds-table__search-icon`
      2. `ds-table__search-input`

<figure><img src="/files/K7WrQlsxvDsfprB0jCRA" alt=""><figcaption></figcaption></figure>

### Table wrapper

The parent class for the table content is `ds-table__wrapper`.

1. `ds-table`
   1. `ds-table__head`
   2. `ds-table__body`

<figure><img src="/files/ogPpwtKGwFBNIdxMwz6I" alt=""><figcaption></figcaption></figure>

#### Table head

The parent class for the table content is `ds-table__head`.

1. `ds-table__row`
   1. `ds-table__cell`
      1. `ds-table__text`
      2. `ds-table__cell-checkbox`

<figure><img src="/files/XvD9DAGHRxybRYMGwZck" alt=""><figcaption></figcaption></figure>

#### Table body

The parent class for the table content is `ds-table__body`.

1. `ds-table__row`
   1. `ds-table__cell`
      1. `ds-table__text`
      2. `ds-table__cell-checkbox`
      3. `ds-table__cell-actions`
         1. `ds-table__cell-actions-button` (This is the actual HTML `<button>` element in the actions menu.)

<figure><img src="/files/YdfrnQf2YgUM1O9eG0pd" alt=""><figcaption></figcaption></figure>

### Controls

The parent class for the table content is `ds-table__controls`.

1. `ds-table__pagination`
2. `ds-table__pagination-button`

<figure><img src="/files/ppbhaNkH3zLYZoP39i0m" alt=""><figcaption></figcaption></figure>

## Rendered DOM

This is the Table raw HTML DOM as loaded in the application, with all classes seen in this section:

<details>

<summary>Table component HTML DOM</summary>

```html
<div class="ds-table__viewport">
  <div class="ds-table__toolbar">
    <div>
      <h3>1 Device</h3>
      <div class="ds-table__toolbar-actions"></div>
    </div>
    <div class="ds-table__filters">
      <div class="ds-table__search">
        <div class="ds-table__search-icon">
          <i class="fa fa-search" role="icon"></i>
        </div>
        <input class="ds-table__search-input" type="search" placeholder="Search" value="">
      </div>
      <button type="button" aria-haspopup="true" aria-expanded="false">
        <i class="fa fa-filter" role="icon"></i>
      </button>
      <button type="button">
        <i class="fas fa-grid-horizontal" role="icon"></i>
      </button>
    </div>
  </div>
  <div class="ds-table__wrapper">
    <table class="ds-table">
      <thead class="ds-table__head ds-table__head--sortable ds-table__head--selectable ds-table__head--actions">
        <tr class="ds-table__row">
          <th class="ds-table__cell" role="columnheader">
            <input class="ds-table__cell-checkbox" type="checkbox">
          </th>
          <th class="ds-table__cell ds-table__cell--sortable">
            <span class="ds-table__text"></span>
          </th>
          <th class="ds-table__cell ds-table__cell--sortable">
            <span class="ds-table__text">Name</span>
          </th>
          <th class="ds-table__cell ds-table__cell--sortable">
            <span class="ds-table__text"></span>
          </th>
          <th class="ds-table__cell ds-table__cell--sortable">
            <span class="ds-table__text">API label</span>
          </th>
          <th class="ds-table__cell ds-table__cell--sortable">
            <span class="ds-table__text">Organization</span>
          </th>
          <th class="ds-table__cell">
            <button type="button" aria-haspopup="true" aria-expanded="false">
              <i class="fa fa-columns" role="icon"></i>
            </button>
          </th>
        </tr>
      </thead>
      <tbody class="ds-table__body">
        <tr class="ds-table__row" role="row">
          <td class="ds-table__cell" role="cell">
            <input class="ds-table__cell-checkbox" type="checkbox">
          </td>
          <td class="ds-table__cell">
            <i class="fa fa-microchip" role="icon"></i>
          </td>
          <td class="ds-table__cell">
            <a href="/app/devices/68a2383d4bc5956b8d5f0b20">Test</a>
          </td>
          <td class="ds-table__cell">
            <div role="status"></div>
          </td>
          <td class="ds-table__cell">
            <span>test</span>
          </td>
          <td class="ds-table__cell">
            <span>Org 1</span>
          </td>
          <td class="ds-table__cell">
            <div class="ds-table__cell-actions ds-table__cell-actions--visible">
              <button type="button" class="ds-table__cell-actions-button">
                <i class="fa fa-sitemap" role="icon"></i>
              </button>
              <button type="button" class="ds-table__cell-actions-button">
                <i class="fa fa-trash" role="icon"></i>
              </button>
            </div>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
  <div class="ds-table__controls">
    <div class="ds-table__pagination">
      <p>Devices per page</p>
      <button type="button" aria-haspopup="true" aria-expanded="false">
        <span>10</span>
        <i class="fa fa-caret-down" role="icon"></i>
      </button>
    </div>
    <div aria-label="pagination info">
      <p aria-label="from number value">1</p>
      -
      <p aria-label="to number value">1</p>
      of
      <p aria-label="total table number value">1</p>
    </div>
    <div>
      <button aria-label="show previous page" class="ds-table__pagination-button ds-table__pagination-button--disabled ds-table__pagination-button--prev" disabled>
        <i class="fa fa-chevron-left" role="icon"></i>
      </button>
      <button aria-label="show next page" class="ds-table__pagination-button ds-table__pagination-button--disabled ds-table__pagination-button--next" disabled>
        <i class="fa fa-chevron-right" role="icon"></i>
      </button>
    </div>
  </div>
</div>
```

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.ubidots.com/apps/styling-with-css/application-css/table.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
