Installation Syntax
Before proceeding, we need to make sure that Angular CLI is installed on the system. To install Material UI, run the below command in the terminal and choose a prebuilt theme or custom.
ng add @angular/material
Please visit this article for detailed installation instructions.
Now, import the MatTableModule, MatPaginatorModule, and HttpClientModule in app.module.ts, and add them to the imports array.
import { MatTableModule } from '@angular/material/table'; import { MatPaginatorModule } from '@angular/material/paginator'; import { HttpClientModule } from '@angular/common/http'; @NgModule({ declarations: [], imports: [ HttpClientModule, MatPaginatorModule, MatTableModule, ], providers: [], bootstrap: [] })
Angular Material Table
Angular Material is a UI component library for Angular to build customizable, responsive, and visually appealing web applications. It takes care of the UI so developers can focus only on core application functionalities. There are several main features, such as it provides numerous UI components out of the box like buttons, tables, tooltips, etc, along with facilitating multiple themes to customize colors, layout, and typography to match the brand. In Angular Material, its components implement ARIA standards to make them accessible, & it’s open-source, with an active community of developers maintaining it.
Material Table is a data table to display data in tabular format. It can be created using <table mat-table>. It displays complex data in a visually simple format.