-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataTable with explicit widths causes headers and table cells to misalign #487
Comments
Can you also add width to ContactName column as well. |
Just to clarify further, this only happens with scrollable=true tables as the header is a separate element from the body. |
+1 on this; same problem here |
I have the same problem with relative width (in %). I precise that it appears only if the scrollbar is not displayed (not enought lines). Actually, the scrollbar width is always "reserved" on the right of the header but not in the lines part. |
Same problem as well |
Also affected by this problem. |
same problem as well |
Same problem as well |
Is this related to premium themes or also happens on other themes as well? |
Here we encounter it with default theme. |
I'm using delta theme, This is related with #859, when setting scrolling="true" this issue occurs. |
sortable, columnResizeMode, scrollHeight, scrollWidth and column toggler. Fixes issues with scrollable: -DataTable with scroll and few data causes headers and table cells to misalign primefaces#917 -dataTable when scrollable and scrollheight is set - style issue primefaces#465 -Column Reorder and Resize support for Scrollable DataTable primefaces#238 -Maybe: DataTable with explicit widths causes headers and table cells to misalign primefaces#487 -Maybe: Datatable scrollable="true" breaks column template header primefaces#859
sortable, columnResizeMode, scrollHeight, scrollWidth, header,footer, filter, paginator, selectionMode, expandableRows with inner table and column toggler. Fixed footer width and partially pagination width when scrollWidth is used Fixes issues with scrollable: -DataTable with scroll and few data causes headers and table cells to misalign primefaces#917 -dataTable when scrollable and scrollheight is set - style issue primefaces#465 -Column Reorder and Resize support for Scrollable DataTable primefaces#238 -Maybe: DataTable with explicit widths causes headers and table cells to misalign primefaces#487 -Maybe: Datatable scrollable="true" breaks column template header primefaces#859
sortable, columnResizeMode, scrollHeight, scrollWidth, header,footer, filter, paginator, selectionMode, expandableRows with inner table and column toggler. Fixed footer width and partially pagination width when scrollWidth is used Fixes issues with scrollable: -DataTable with scroll and few data causes headers and table cells to misalign primefaces#917 -dataTable when scrollable and scrollheight is set - style issue primefaces#465 -Column Reorder and Resize support for Scrollable DataTable primefaces#238 -Maybe: DataTable with explicit widths causes headers and table cells to misalign primefaces#487 -Maybe: Datatable scrollable="true" breaks column template header primefaces#859
sortable, columnResizeMode, scrollHeight, scrollWidth, header,footer, filter, paginator, selectionMode, expandableRows with inner table and column toggler. Fixed footer width and partially pagination width when scrollWidth is used Fixes issues with scrollable: -DataTable with scroll and few data causes headers and table cells to misalign primefaces#917 -dataTable when scrollable and scrollheight is set - style issue primefaces#465 -Column Reorder and Resize support for Scrollable DataTable primefaces#238 -Maybe: DataTable with explicit widths causes headers and table cells to misalign primefaces#487 -Maybe: Datatable scrollable="true" breaks column template header primefaces#859
Hi, same problem as well I'm using delta theme, |
1171 adds improvements to scrollable and I can't replicate this right now, please try with upcoming RC1 and drop a comment if you still experience it then we'll reopen. |
when I put the resizableColumns="true", columns with explicit witdh, do not respect such wide.
|
Why is this closed? It is still a problem even with final release |
I think I was mistaken - seems to be fixed |
I still have this issue when I use the Bootstrap theme. Column headers are too narrow when I find that this issue only occurs when there are not enough rows to fill up the <p-dialog #dialog (onBeforeShow)="onBeforeShow($event)" (onBeforeHide)="onBeforeHide($event)" [header]="title" [(visible)]="visible"
modal="modal">
<div style="max-width: 600px;">
<p-dataTable #dt [value]="values" selectionMode="single" [(selection)]="current" [globalFilter]="filter" scrollable="true"
scrollHeight="300px">
<p-header>
<div class="ui-widget-header">
<div class="has-feedback">
<input #filter type="text" class="form-control" placeholder="Search">
<span class="fa fa-search form-control-feedback"></span>
</div>
</div>
</p-header>
<p-column field="name" header="Name"></p-column>
<p-column field="isnType" header="Type"></p-column>
<p-column field="description" header="Description"></p-column>
</p-dataTable>
</div>
<p-footer>
<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
<button type="button" class="btn btn-primary" (click)="confirm($event)">OK</button>
<button type="button" class="btn btn-default" (click)="dialog.hide($event);">Cancel</button>
</div>
</p-footer>
</p-dialog> |
Yep. Still an issue on bootsrtrap theme. |
Still an issue with the Omega theme as well (but not super noticeable) . And probably with all other themes, because I don't think it's just a styling issue. See my previous comment. |
cc @cagataycivici div.ui-datatable-scrollable-body {
overflow-y: scroll;
} This style causes the scrollbar of the scrollable part to always be visible. This prevents the table body from expanding and becoming misaligned with the table headers. |
Thanks for the work-around @StevenLiekens |
This issue is a bit bloated with different cases, please create a new ticket if issue still persists with 4.0.2. |
Is 4.0.2 already out? Have installed 4.0.1 right now. |
Not yet, will be by tuesday. If you can provide a plunkr right now, that would help so we can review before release. But this was discussed many times, technically table-layout auto is not supported bh scrollable tables so we cant do much about it. |
I got the plunkr to work: https://plnkr.co/edit/BQEPSsjz8UJO4bVf8jgi?p=preview |
Hi MrToasty97 |
I can't check it right now, but as I know I've put it in the gobal styles.css file. |
i fix it use the global css .ui-datatable-scrollable-header-box{
margin-right: 17px!important;
}
div.ui-datatable-scrollable-body {
overflow-y: scroll;
} |
@giscafer This works fine with a maximum client window size; But did you try resize your window size? The mis-aligned issue still exists! update: It occurs only when you set every column's width with an explicit width. try set seval columns width before they fixed this issue |
@cagataycivici I am still getting this behavior with 4.1.1 |
@bhaidar i am not getting any issues with the "LTR" but with "RTL",i am having the same mentioned issue. |
We're experiencing this really annoying issue in our app. Are the devs even looking into this? This bug is coming up to a year and a half old. |
I'm struggling with this issue as well... is there gonna be a fix for this? |
It works for me: .ui-datatable-scrollable-header-box{ .ui-datatable-scrollable-body { .ui-datatable-scrollable-header { |
For any future dev who stumbles upon this: |
I experienced this issue too, it is not related with primefaces at all, it is happening when you use a template based on bootstrap i think most of the templates are based on bootstrap, you have to locate the code in bootstrap.css of your template and delete it, in my case i deleted all the css related with glyphicon and the beggining of the file, i dont know if this is the best solution but it worked for me. |
These styles alone did not solve the problem when the table width became too small. Adding the following finally did the trick for me. This fixes the column width mismatch problem: This fixes the problem with the cell contents overlapping the boundaries of the cells. If you do not like the scrollbar and would rather see the content chopped off, use hidden instead of auto. |
Use checkboxes to remove issue filters.
The following table:
(And any other table that uses explicit widths) causes the following layout issues:
I am using the Modena theme, so not sure if it could be this. There is no CSS interfearing with the table (I assume given encapsulation and my brief inspection appears to support this).
The text was updated successfully, but these errors were encountered: