Movatterモバイル変換


[0]ホーム

URL:


CoreUI Angular Logo
Framework:
Getting startedIntroductionSupport CoreUICustomizeSassOptionsCSS VariablesLayoutBreakpointsContainersGridColumnsGuttersFormsOverviewAutocompletePRODate 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 howcTable 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

Usestriped property to add zebra-striping to any table row within thetbody.

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

Striped columns

UsestripedColumns property to add zebra-striping to any table column.

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

Usecolor 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

Usehover property to enable a hover state on table rows within atbody.

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

These hoverable rows can also be combined with thestriped variant:

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

Active tables

Highlight a table row or cell by adding acTableActive property.

#ClassHeadingHeading
1MarkOtto@mdo
2JacobThornton@fat
3 Larry the Bird@twitter
Loading...
import { Component } from '@angular/core';import { TableActiveDirective, TableDirective } from '@coreui/angular';@Component({  selector: 'docs-table08',  templateUrl: './table08.component.html',  standalone: true,  imports: [TableDirective, TableActiveDirective]})export class Table08Component {}

Bordered tables

Addbordered 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

Addborderless property for a table without borders.

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

Small tables

Addsmall property to make anycTable more compact by cutting all cellpadding in half.

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

Vertical alignment

Table cells ofthead are always vertical aligned to thebottom. Table cells intbody inherit their alignment fromcTable and are aligned to the the top by default. Use the alignproperty to re-align where needed.

Heading 1 Heading 2 Heading 3 Heading 4
This cell inheritsvertical-align: middle; from the table This cell inheritsvertical-align: middle; from the table This cell inheritsvertical-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 inheritsvertical-align: bottom; from the table row This cell inheritsvertical-align: bottom; from the table row This cell inheritsvertical-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 inheritsvertical-align: middle; from the table This cell inheritsvertical-align: middle; from the tableThis 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 propcolor="light" orcolor="dark" to makethead 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

Acaption 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 withcaption="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 aresponsive property.

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

Breakpoint specific

Or pick a maximum breakpoint with which to have a responsive table up to by usingresponsive="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 fortable element

Inputs:

proptypedefaultdescription
alignAlignmentsundefinedtable cells vertical alignment
borderColorColorsundefinedborder color for bordered table
borderedbooleanundefinedadds borders on all sides of the table and cells
borderlessbooleanundefinedfor a table without borders at all
captiontopundefinedputscaption on the top of the table
colorColorsundefinedsets color of whole table
hoverbooleanundefinedenable a hover state on table rows within atbody
responsiveboolean / breakpointundefinedadds responsive wrapper to table or pick a maximum breakpoint
smallbooleanundefinedmakes compact table by cutting all cell padding in half
stripedbooleanundefinedadds striping to any table row within thetbody
stripedColumnsbooleanundefinedadds striping to any table column

cTableActive

directive fortr ortd elements

Inputs:

proptypedefaultdescription
cTableActivebooleanundefinedadd highlight to rowtr or celltd

cTableColor

directive fortable,thead,th,tbody,tfoottr ortd elements

  Input:
proptypedefaultdescription
cTableColorColorsundefinedadd color tables, rows or individual cells

cAlign

directive fortable,thead,th,tbody,tfoottr ortd elements

Input:

proptypedefaultdescription
cAligntopbottommiddleundefinedvertical alignment for cellstable,tr ortd

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

Currently v5.5.17 Code licensed MIT, docs CC BY 3.0 .
CoreUI PRO requires acommercial license.


[8]ページ先頭

©2009-2025 Movatter.jp