diff --git a/src/app/components/table/table.css b/src/app/components/table/table.css index 351de0466ed..b56b4823b53 100755 --- a/src/app/components/table/table.css +++ b/src/app/components/table/table.css @@ -122,6 +122,24 @@ z-index: 1; } +.p-datatable-scrollable.p-datatable-grouped-header .p-datatable-thead, +.p-datatable-scrollable.p-datatable-grouped-footer .p-datatable-tfoot { + display: table; + border-collapse: collapse; + width: 100%; + table-layout: fixed; +} + +.p-datatable-scrollable.p-datatable-grouped-header .p-datatable-thead > tr, +.p-datatable-scrollable.p-datatable-grouped-footer .p-datatable-tfoot > tr { + display: table-row; +} + +.p-datatable-scrollable.p-datatable-grouped-header .p-datatable-thead > tr > th, +.p-datatable-scrollable.p-datatable-grouped-footer .p-datatable-tfoot > tr > td { + display: table-cell; +} + /* Frozen Columns */ .p-datatable-frozen-view .p-datatable-scrollable-body { overflow: hidden; diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index 68568325af0..56ea9e58075 100755 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -84,7 +84,9 @@ export class TableService { 'p-datatable-scrollable-horizontal': scrollable && scrollDirection === 'horizontal', 'p-datatable-scrollable-both': scrollable && scrollDirection === 'both', 'p-datatable-flex-scrollable': (scrollable && scrollHeight === 'flex'), - 'p-datatable-responsive': responsive}" [attr.id]="id"> + 'p-datatable-responsive': responsive, + 'p-datatable-grouped-header': headerGroupedTemplate != null, + 'p-datatable-grouped-footer': footerGroupedTemplate != null}" [attr.id]="id">
@@ -100,24 +102,24 @@ export class TableService { - + - - + +
- + - - + +
@@ -354,6 +356,8 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable headerTemplate: TemplateRef; + headerGroupedTemplate: TemplateRef; + bodyTemplate: TemplateRef; loadingBodyTemplate: TemplateRef; @@ -364,6 +368,8 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable footerTemplate: TemplateRef; + footerGroupedTemplate: TemplateRef; + summaryTemplate: TemplateRef; colGroupTemplate: TemplateRef; @@ -499,6 +505,10 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable this.headerTemplate = item.template; break; + case 'headergrouped': + this.headerGroupedTemplate = item.template; + break; + case 'body': this.bodyTemplate = item.template; break; @@ -511,6 +521,10 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable this.footerTemplate = item.template; break; + case 'footergrouped': + this.footerGroupedTemplate = item.template; + break; + case 'summary': this.summaryTemplate = item.template; break;