[X ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
style="width: 3698px;" -- this has broken all my layouts.
**Expected behavior**
**What is the motivation / use case for changing the behavior?**
I use the width of the table and lock it to the area required and then use scrollable to scroll the content only.
If I edit the table in chrome removing the width style the table returns to the original layout.
**Please tell us about your environment:**
Windows, Chrome, angular 12 prime 12
* **Angular version:** 12.2.13
* **PrimeNG version:** 1212.2.2
* **Browser:** [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Chrome
* **Language:** TypeScript 4.3.5
* **Node (for AoT issues):** `node --version` = v14.18.1
I removed columnResizeMode="expand" and the tables work OK again. It appears the width was added to the wrong spot on the table layout, it should be lower in the heirarchy
the caption and footer width should not be affected by this change.
This is the section that I believe the style is associated with the actual scrollable data. Quite simply put the width tag is in the wrong place on the table.
temporary solution is to remove the expand option which breaks short layouts.
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
<p-table #table *ngIf='tableSettings && tableData && !(loading$| async)' [value]="tableData" [columns]='tableSettings.selectedColumns' [frozenColumns]='tableSettings.frozenColumns' [frozenWidth]='tableSettings.frozenWidth' [(selection)]='selected' [paginator]="paginator" [rows]="50" [resizableColumns]="true" [scrollable]="true" columnResizeMode="expand" [reorderableColumns]="true" [rowsPerPageOptions]="[10,20,50,100]" [exportFilename]="filename" [exportFunction]="exportFunction" (onRowSelect)="onRowSelect($event)" (onRowUnselect)="onRowUnselect($event)" selectionMode="single" [globalFilterFields]="tableSettings.globalFilter" stateStorage="{{stateKey ? 'local' : 'session'}}" [stateKey]="stateKey" (onFilter)="onFilterTable($event)" (onSort)="onSortTable($event)" (onColReorder)="onColReorderTable($event)" [dataKey]='dataKey' (onColResize)="onColResizeTable($event)"> <ng-template pTemplate="caption" let-columns>
<ng-template pTemplate="colgroup" let-columns>
<ng-template pTemplate="header" let-columns>
<ng-template pTemplate="body" let-rowData let-columns='columns' let-index="rowIndex"> <tr (dblclick)="viewDetail($any($event), rowData)" [pSelectableRow]="rowData" [ngClass]='highlightRow(rowData)'> <td ngFor="let col of columns;trackBy:trackBy" [ngClass]="{'more': col?.dataType === 9}" [ngSwitch]='col?.dataType'> <app-date ngSwitchCase='1' [date]='rowData[col.field]'> <span ngSwitchCase='5'> <span ngIf='col.format; else dt'> {{rowData[col.field] ? (rowData[col.field]|date:col.format) : '-'}} <ng-template #dt> <app-date-time [date]='rowData[col.field]'>
Current behavior
I removed columnResizeMode="expand" and the tables work OK again. It appears the width was added to the wrong spot on the table layout, it should be lower in the heirarchy
the caption and footer width should not be affected by this change.
Issue is not clear, please feel free to reopen with a stackblitz example or poject.
Image without expand
After adding columnResizeMode="expand" - still fine
After reloading again (simple F5) to reset the table again:
Note the missing buttons on the right.
HTML of the table is as follows:
<div ng-reflect-ng-class="[object Object]" id="pr_id_14" class="p-datatable p-component p-datatable-hoverable-rows p-datatable-resizable p-datatable-scrollable p-datatable-scrollable-vertical p-datatable-responsive-stack" style="width: 3822px;">
Note the style="width: 3822px;" which is related to columnResizeMode="expand" in table.ts
I go into chrome and remove that style width, the screen returns to normal:
This is the section that I believe the style is associated with the actual scrollable data. Quite simply put the width tag is in the wrong place on the table.
temporary solution is to remove the expand option which breaks short layouts.
@yigitfindikli Please review additional information and reopen.
https://github.com/primefaces/primeng/issues/10919
While the modification above works correctly it may be a better solution to remove that line entirely. It is only in the recover on restore logic.