Skip to content

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

License

Notifications You must be signed in to change notification settings

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

 
 

Repository files navigation

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)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 55.8%
  • HTML 34.5%
  • JavaScript 7.6%
  • CSS 2.1%