Skip to content

PubTable ​

This is a table component. It is used to display a table and supports various table styles, such as default, hoverable, and striped.

Default Usage ​

Use PubTable with PubTableHead, PubTableBody, PubTableRow, PubTableHeadCell, and PubTableCell to compose a structured data table.

Product nameColorCategoryPriceEdit
Louis Vuitton Neverfull ToteBrownHandbag₹1,65,000 Edit
Gucci GG Marmont Shoulder BagBlackShoulder Bag₹2,10,000 Edit
Nike Utility BackpackNavyBackpack₹4,499 Edit
vue
<template>
  <pub-table>
    <pub-table-head>
      <pub-table-head-cell>Product name</pub-table-head-cell>
      <pub-table-head-cell>Color</pub-table-head-cell>
      <pub-table-head-cell>Category</pub-table-head-cell>
      <pub-table-head-cell>Price</pub-table-head-cell>
      <pub-table-head-cell>
        <span class="sr-only">Edit</span>
      </pub-table-head-cell>
    </pub-table-head>
    <pub-table-body>
      <pub-table-row>
        <pub-table-cell>Louis Vuitton Neverfull Tote</pub-table-cell>
        <pub-table-cell>Brown</pub-table-cell>
        <pub-table-cell>Handbag</pub-table-cell>
        <pub-table-cell>₹1,65,000</pub-table-cell>
        <pub-table-cell>
          <pub-a href="#">
            Edit
          </pub-a>
        </pub-table-cell>
      </pub-table-row>

      <pub-table-row>
        <pub-table-cell>Gucci GG Marmont Shoulder Bag</pub-table-cell>
        <pub-table-cell>Black</pub-table-cell>
        <pub-table-cell>Shoulder Bag</pub-table-cell>
        <pub-table-cell>₹2,10,000</pub-table-cell>
        <pub-table-cell>
          <pub-a href="#">
            Edit
          </pub-a>
        </pub-table-cell>
      </pub-table-row>

      <pub-table-row>
        <pub-table-cell>Nike Utility Backpack</pub-table-cell>
        <pub-table-cell>Navy</pub-table-cell>
        <pub-table-cell>Backpack</pub-table-cell>
        <pub-table-cell>₹4,499</pub-table-cell>
        <pub-table-cell>
          <pub-a href="#">
            Edit
          </pub-a>
        </pub-table-cell>
      </pub-table-row>
    </pub-table-body>
  </pub-table>
</template>

<script lang="ts" setup>
import {
    PubA,
    PubTable,
    PubTableBody,
    PubTableCell,
    PubTableHead,
    PubTableHeadCell,
    PubTableRow,
} from 'vuelicity'
</script>

Colored Table ​

Prop - color Usage ​

The color prop can be used to change the color of the table.

Product nameColorCategoryPriceEdit
Louis Vuitton Neverfull ToteBrownHandbag₹1,65,000 Edit
Gucci GG Marmont Shoulder BagBlackShoulder Bag₹2,10,000 Edit
Nike Utility BackpackNavyBackpack₹4,499 Edit
vue
<template>
  <pub-table color="green">
    <pub-table-head>
      <pub-table-head-cell>Product name</pub-table-head-cell>
      <pub-table-head-cell>Color</pub-table-head-cell>
      <pub-table-head-cell>Category</pub-table-head-cell>
      <pub-table-head-cell>Price</pub-table-head-cell>
      <pub-table-head-cell>
        <span class="sr-only">Edit</span>
      </pub-table-head-cell>
    </pub-table-head>
    <pub-table-body>
      <pub-table-row>
        <pub-table-cell>Louis Vuitton Neverfull Tote</pub-table-cell>
        <pub-table-cell>Brown</pub-table-cell>
        <pub-table-cell>Handbag</pub-table-cell>
        <pub-table-cell>₹1,65,000</pub-table-cell>
        <pub-table-cell>
          <pub-a href="#">
            Edit
          </pub-a>
        </pub-table-cell>
      </pub-table-row>

      <pub-table-row>
        <pub-table-cell>Gucci GG Marmont Shoulder Bag</pub-table-cell>
        <pub-table-cell>Black</pub-table-cell>
        <pub-table-cell>Shoulder Bag</pub-table-cell>
        <pub-table-cell>₹2,10,000</pub-table-cell>
        <pub-table-cell>
          <pub-a href="#">
            Edit
          </pub-a>
        </pub-table-cell>
      </pub-table-row>

      <pub-table-row>
        <pub-table-cell>Nike Utility Backpack</pub-table-cell>
        <pub-table-cell>Navy</pub-table-cell>
        <pub-table-cell>Backpack</pub-table-cell>
        <pub-table-cell>₹4,499</pub-table-cell>
        <pub-table-cell>
          <pub-a href="#">
            Edit
          </pub-a>
        </pub-table-cell>
      </pub-table-row>
    </pub-table-body>
  </pub-table>
</template>

<script lang="ts" setup>
import {
    PubA,
    PubTable,
    PubTableBody,
    PubTableCell,
    PubTableHead,
    PubTableHeadCell,
    PubTableRow,
} from 'vuelicity'
</script>

Striped Rows ​

Prop - striped Usage ​

The striped prop can be used to add a stripe pattern to the rows of the table.

Product nameColorCategoryPriceEdit
Louis Vuitton Neverfull ToteBrownHandbag₹1,65,000 Edit
Gucci GG Marmont Shoulder BagBlackShoulder Bag₹2,10,000 Edit
Nike Utility BackpackNavyBackpack₹4,499 Edit
vue
<template>
  <pub-table striped>
    <pub-table-head>
      <pub-table-head-cell>Product name</pub-table-head-cell>
      <pub-table-head-cell>Color</pub-table-head-cell>
      <pub-table-head-cell>Category</pub-table-head-cell>
      <pub-table-head-cell>Price</pub-table-head-cell>
      <pub-table-head-cell>
        <span class="sr-only">Edit</span>
      </pub-table-head-cell>
    </pub-table-head>
    <pub-table-body>
      <pub-table-row>
        <pub-table-cell>Louis Vuitton Neverfull Tote</pub-table-cell>
        <pub-table-cell>Brown</pub-table-cell>
        <pub-table-cell>Handbag</pub-table-cell>
        <pub-table-cell>₹1,65,000</pub-table-cell>
        <pub-table-cell>
          <pub-a href="#">
            Edit
          </pub-a>
        </pub-table-cell>
      </pub-table-row>

      <pub-table-row>
        <pub-table-cell>Gucci GG Marmont Shoulder Bag</pub-table-cell>
        <pub-table-cell>Black</pub-table-cell>
        <pub-table-cell>Shoulder Bag</pub-table-cell>
        <pub-table-cell>₹2,10,000</pub-table-cell>
        <pub-table-cell>
          <pub-a href="#">
            Edit
          </pub-a>
        </pub-table-cell>
      </pub-table-row>

      <pub-table-row>
        <pub-table-cell>Nike Utility Backpack</pub-table-cell>
        <pub-table-cell>Navy</pub-table-cell>
        <pub-table-cell>Backpack</pub-table-cell>
        <pub-table-cell>₹4,499</pub-table-cell>
        <pub-table-cell>
          <pub-a href="#">
            Edit
          </pub-a>
        </pub-table-cell>
      </pub-table-row>
    </pub-table-body>
  </pub-table>
</template>

<script lang="ts" setup>
import {
    PubA,
    PubTable,
    PubTableBody,
    PubTableCell,
    PubTableHead,
    PubTableHeadCell,
    PubTableRow,
} from 'vuelicity'
</script>

Striped Columns ​

Prop - striped-columns Usage ​

The striped-columns prop can be used to add a stripe pattern to the columns of the table.

Product nameColorCategoryPriceEdit
Louis Vuitton Neverfull ToteBrownHandbag₹1,65,000 Edit
Gucci GG Marmont Shoulder BagBlackShoulder Bag₹2,10,000 Edit
Nike Utility BackpackNavyBackpack₹4,499 Edit
vue
<template>
  <pub-table striped-columns>
    <pub-table-head>
      <pub-table-head-cell>Product name</pub-table-head-cell>
      <pub-table-head-cell>Color</pub-table-head-cell>
      <pub-table-head-cell>Category</pub-table-head-cell>
      <pub-table-head-cell>Price</pub-table-head-cell>
      <pub-table-head-cell>
        <span class="sr-only">Edit</span>
      </pub-table-head-cell>
    </pub-table-head>
    <pub-table-body>
      <pub-table-row>
        <pub-table-cell>Louis Vuitton Neverfull Tote</pub-table-cell>
        <pub-table-cell>Brown</pub-table-cell>
        <pub-table-cell>Handbag</pub-table-cell>
        <pub-table-cell>₹1,65,000</pub-table-cell>
        <pub-table-cell>
          <pub-a href="#">
            Edit
          </pub-a>
        </pub-table-cell>
      </pub-table-row>

      <pub-table-row>
        <pub-table-cell>Gucci GG Marmont Shoulder Bag</pub-table-cell>
        <pub-table-cell>Black</pub-table-cell>
        <pub-table-cell>Shoulder Bag</pub-table-cell>
        <pub-table-cell>₹2,10,000</pub-table-cell>
        <pub-table-cell>
          <pub-a href="#">
            Edit
          </pub-a>
        </pub-table-cell>
      </pub-table-row>

      <pub-table-row>
        <pub-table-cell>Nike Utility Backpack</pub-table-cell>
        <pub-table-cell>Navy</pub-table-cell>
        <pub-table-cell>Backpack</pub-table-cell>
        <pub-table-cell>₹4,499</pub-table-cell>
        <pub-table-cell>
          <pub-a href="#">
            Edit
          </pub-a>
        </pub-table-cell>
      </pub-table-row>
    </pub-table-body>
  </pub-table>
</template>

<script lang="ts" setup>
import {
    PubA,
    PubTable,
    PubTableBody,
    PubTableCell,
    PubTableHead,
    PubTableHeadCell,
    PubTableRow,
} from 'vuelicity'
</script>

Hover state ​

Prop - hoverable Usage ​

The hoverable prop can be used to add a hover state to the rows of the table.

Product nameColorCategoryPriceEdit
Louis Vuitton Neverfull ToteBrownHandbag₹1,65,000 Edit
Gucci GG Marmont Shoulder BagBlackShoulder Bag₹2,10,000 Edit
Nike Utility BackpackNavyBackpack₹4,499 Edit
vue
<template>
  <pub-table hoverable>
    <pub-table-head>
      <pub-table-head-cell>Product name</pub-table-head-cell>
      <pub-table-head-cell>Color</pub-table-head-cell>
      <pub-table-head-cell>Category</pub-table-head-cell>
      <pub-table-head-cell>Price</pub-table-head-cell>
      <pub-table-head-cell>
        <span class="sr-only">Edit</span>
      </pub-table-head-cell>
    </pub-table-head>
    <pub-table-body>
      <pub-table-row>
        <pub-table-cell>Louis Vuitton Neverfull Tote</pub-table-cell>
        <pub-table-cell>Brown</pub-table-cell>
        <pub-table-cell>Handbag</pub-table-cell>
        <pub-table-cell>₹1,65,000</pub-table-cell>
        <pub-table-cell>
          <pub-a href="#">
            Edit
          </pub-a>
        </pub-table-cell>
      </pub-table-row>

      <pub-table-row>
        <pub-table-cell>Gucci GG Marmont Shoulder Bag</pub-table-cell>
        <pub-table-cell>Black</pub-table-cell>
        <pub-table-cell>Shoulder Bag</pub-table-cell>
        <pub-table-cell>₹2,10,000</pub-table-cell>
        <pub-table-cell>
          <pub-a href="#">
            Edit
          </pub-a>
        </pub-table-cell>
      </pub-table-row>

      <pub-table-row>
        <pub-table-cell>Nike Utility Backpack</pub-table-cell>
        <pub-table-cell>Navy</pub-table-cell>
        <pub-table-cell>Backpack</pub-table-cell>
        <pub-table-cell>₹4,499</pub-table-cell>
        <pub-table-cell>
          <pub-a href="#">
            Edit
          </pub-a>
        </pub-table-cell>
      </pub-table-row>
    </pub-table-body>
  </pub-table>
</template>

<script lang="ts" setup>
import {
    PubA,
    PubTable,
    PubTableBody,
    PubTableCell,
    PubTableHead,
    PubTableHeadCell,
    PubTableRow,
} from 'vuelicity'
</script>

Reference ​

PubTable ​

Properties ​

NameTypeDefaultDescriptionOptions
classString''Additional CSS classes to apply.
wrapperClassString''Additional CSS classes to apply to the wrapper.
colorStringdefaultThe theme color of the table.'default', 'red', 'blue', 'green', 'yellow', 'pink', 'cyan', 'purple', 'grey'
stripedBooleanfalseAdd a stripe pattern to the rows.
stripedColumnsBooleanfalseAdd a stripe pattern to the columns.
hoverableBooleanfalseAdd a hover state to the rows.

Slots ​

NameDescription
defaultTable content — PubTableHead and PubTableBody elements.

PubTableBody ​

Slots ​

NameDescription
defaultOne or more PubTableRow elements.

PubTableCell ​

Slots ​

NameDescription
defaultDefault slot for content.

PubTableHead ​

Slots ​

NameDescription
defaultOne or more PubTableHeadCell elements.

PubTableHeadCell ​

Slots ​

NameDescription
defaultDefault slot for content.

PubTableRow ​

Slots ​

NameDescription
defaultOne or more PubTableCell elements.

Released under the MIT License.