ManfredWind / angular-material-nested-and-expanded-tables

Different approaches for designing tables with Angular 5 Material (Simple, Simple-Nested, Expanded and Fully-Expanded)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular 5 Material Nested And Expanded Tables

This is an example of different approaches to display tabular data using Angular 5 Material.

Let's say you have the following JSON object and you are required to display it as a table:

[
  {
    "co1": "value",
    "col2": "value",
    "col3": "value",
    "subCols": [
      {
        "co1": "value",
        "col2": "value",
        "col3": "value"
      }
    ]
  }
]

Displaying a simple Angular Material table with a nested table for "subCols" should be very easy.

On the other hand, expanded tables are a bit tricky, they may seem nested but they really aren't. In my opinion it's a nicer approach because they provide better user experience and more custom CSS flexibility (especially the fully-expanded). The only thing is that you'll need a bit more code to make them work.

Peek:

  • Simple table:

Alt text

  • Simple-Nested table:

Alt text

  • Expanded-Nested table:

Alt text

  • Fully-Expanded table:

Alt text

About

Different approaches for designing tables with Angular 5 Material (Simple, Simple-Nested, Expanded and Fully-Expanded)

License:MIT License


Languages

Language:TypeScript 55.8%Language:HTML 34.5%Language:JavaScript 7.6%Language:CSS 2.1%