CoreUI Angular Logo
Framework:
  • JavaScript / Vanilla JS
  • React.js
  • Vue.js
Getting startedIntroductionSupport CoreUICustomizeSassOptionsCSS VariablesLayoutBreakpointsContainersGridColumnsGuttersFormsOverviewDate PickerPRODate Range PickerPROForm ControlSelectMulti SelectPROChecks & RadiosPassword InputPRORangeRange SliderPRORatingPROStepperPROInput GroupFloating LabelsLayoutTime PickerPROValidationComponentsAccordionAlertAvatarBadgeBreadcrumbButtonButton GroupCalendarPROCalloutCardCarouselClose buttonCollapseDropdownFooterHeaderImageList GroupLoading ButtonPROModalNavNavbarOffcanvasPaginationPlaceholderPopoverProgressSmart PaginationPROSmart TablePROSidebarSpinnerTableTabsNewToastTooltipWidgetsIconsChartsTemplatesNewAdmin & DashboardDownloadInstallationCustomizeContentMigrationv4 → v5v3 → v4Angular version


DownloadHire UsGet CoreUI PRO
On this page

Angular Table Directives

Documentation and examples for opt-in styling of Angular tables.

Examples

Using the most basic table CoreUI, here's how cTable based tables look in CoreUI.

#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
Loading...
Loading...

Variants

Use contextual classes to color tables, table rows or individual cells.

ClassHeadingHeading
DefaultCellCell
PrimaryCellCell
SecondaryCellCell
SuccessCellCell
DangerCellCell
WarningCellCell
InfoCellCell
LightCellCell
DarkCellCell
Loading...
Loading...

Striped rows

Use striped property to add zebra-striping to any table row within the tbody.

#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
Loading...
Loading...

Striped columns

Use stripedColumns property to add zebra-striping to any table column.

#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
Loading...
Loading...

Use color property to add some color variants.

#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
Loading...
Loading...
#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
Loading...
Loading...

Hoverable rows

Use hover property to enable a hover state on table rows within a tbody.

#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
Loading...
Loading...

These hoverable rows can also be combined with the striped variant:

#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
Loading...
Loading...

Active tables

Highlight a table row or cell by adding a cTableActive property.

#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3 Larry the Bird @twitter
Loading...
Loading...

Bordered tables

Add bordered property for borders on all sides of the table and cells.

#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
Loading...
Loading...

Border color utilities can be added to change colors:

#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
Loading...
Loading...

Borderless

Add borderless property for a table without borders.

#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
Loading...
Loading...

Small tables

Add small property to make any cTable more compact by cutting all cell padding in half.

#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
Loading...
Loading...

Vertical alignment

Table cells of thead are always vertical aligned to the bottom. Table cells in tbody inherit their alignment from cTable and are aligned to the the top by default. Use the align property to re-align where needed.

Heading 1 Heading 2 Heading 3 Heading 4
This cell inherits vertical-align: middle; from the table This cell inherits vertical-align: middle; from the table This cell inherits vertical-align: middle; from the table This here is some placeholder text, intended to take up quite a bit of vertical space, to demonstrate how the vertical alignment works in the preceding cells.
This cell inherits vertical-align: bottom; from the table row This cell inherits vertical-align: bottom; from the table row This cell inherits vertical-align: bottom; from the table row This here is some placeholder text, intended to take up quite a bit of vertical space, to demonstrate how the vertical alignment works in the preceding cells.
This cell inherits vertical-align: middle; from the table This cell inherits vertical-align: middle; from the table This cell is aligned to the top. This here is some placeholder text, intended to take up quite a bit of vertical space, to demonsCTableRowate how the vertical alignment works in the preceding cells.
Loading...
Loading...

Nesting

Border styles, active styles, and table variants are not inherited by nested tables.

#ClassHeadingHeading
1MarkOtto@mdo
HeaderHeaderHeader
AFirstLast
BFirstLast
CFirstLast
3Larry the Bird@twitter
Loading...
Loading...

Table head

Similar to tables and dark tables, use the modifier prop color="light" or color="dark" to make thead appear light or dark gray.

#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
Loading...
Loading...
#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
Loading...
Loading...

Table foot

#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
FooterFooterFooterFooter
Loading...
Loading...

Captions

A caption functions like a heading for a table. It helps users with screen readers to find a table and understand what it's about and decide if they want to read it.

List of users
#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
Loading...
Loading...

You can also put a caption on the top of the table with caption="top".

List of users
#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
Loading...
Loading...

Responsive tables

Always responsive

Responsive tables allow tables to be scrolled horizontally with ease. Make any table responsive across all viewports by adding a responsive property.

#HeadingHeadingHeadingHeadingHeadingHeadingHeadingHeading
1CellCellCellCellCellCellCellCell
2CellCellCellCellCellCellCellCell
3CellCellCellCellCellCellCellCell
Loading...
Loading...

Breakpoint specific

Or pick a maximum breakpoint with which to have a responsive table up to by using responsive="sm|md|lg|xl|xxl".

#HeadingHeadingHeadingHeadingHeadingHeadingHeadingHeading
1CellCellCellCellCellCellCellCell
2CellCellCellCellCellCellCellCell
3CellCellCellCellCellCellCellCell
Loading...
Loading...

API reference

Table Module

import { TableModule, UtilitiesModule } from '@coreui/angular';

@NgModule({
   imports: [
     TableModule,
     UtilitiesModule
   ]
})
export class AppModule() { }

cTable

directive for table element

Inputs:

prop type default description
align Alignments undefined table cells vertical alignment
borderColor Colors undefined border color for bordered table
bordered boolean undefined adds borders on all sides of the table and cells
borderless boolean undefined for a table without borders at all
caption top undefined puts caption on the top of the table
color Colors undefined sets color of whole table
hover boolean undefined enable a hover state on table rows within a tbody
responsive boolean / breakpoint undefined adds responsive wrapper to table or pick a maximum breakpoint
small boolean undefined makes compact table by cutting all cell padding in half
striped boolean undefined adds striping to any table row within the tbody
stripedColumns boolean undefined adds striping to any table column

cTableActive

directive for tr or td elements

Inputs:

prop type default description
cTableActive boolean undefined add highlight to row tr or cell td

cTableColor

directive for table, thead, th, tbody, tfoot tr or td elements

  Input:
prop type default description
cTableColor Colors undefined add color tables, rows or individual cells

cAlign

directive for table, thead, th, tbody, tfoot tr or td elements

Input:

prop type default description
cAlign top bottom middle undefined vertical alignment for cells table, tr or td
  • GitHub
  • Twitter
  • Support
  • CoreUI (Vanilla)
  • CoreUI for React.js
  • CoreUI for Vue.js

CoreUI for Angular is Open Source UI Components Library for Angular.

Currently v5.5.1 Code licensed MIT , docs CC BY 3.0 .
CoreUI PRO requires a commercial license.