Skip to content
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

Table headers pushed to left #191

Closed
Jay6111 opened this issue Feb 2, 2021 · 2 comments
Closed

Table headers pushed to left #191

Jay6111 opened this issue Feb 2, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@Jay6111
Copy link

Jay6111 commented Feb 2, 2021

Single tab worked fine but when I separated the code into multiple tabs, the HTML page opens on a random tab. That tab will have all table headers aligned properly, but any other tab the table headers are all pushed to the far left while the data remains properly centered.
As soon as you sort any column this fixes the column headers for that table but has to be done for each and every table on that tab.
Table-Header

The code for that particular section is,

New-HTMLTab -TabName "Msol" -TabHeading $ReportTitleDate -IconBrands microsoft {
New-HTMLSection -Name "O365 User Stats" -BackgroundColor DarkGray -CanCollapse -HeaderBackGroundColor Gray {
New-HTMLSection -Name 'O365 Users' -HeaderTextAlignment left -CanCollapse -HeaderBackGroundColor MediumVioletRed -BackgroundColor Lavender {
New-htmlPanel {
new-htmlTable -DataTable $O365UsersTable -DisableResponsiveTable -HideFooter -PagingOptions 15, 30, 50 -ScrollX #-ScrollX -ScrollY -ScrollSizeY 300
}
}
}

@PrzemyslawKlys
Copy link
Member

This is related to ScrollX. Seems like a bug but most likely not directly in PSWriteHTML. If you remove -ScrollX it will work.

New-HTML {
    New-HTMLTab -TabName "Msol" -TabHeading $ReportTitleDate -IconBrands microsoft {
        New-HTMLTable -DataTable $O365UsersTable -HideFooter -DisableResponsiveTable -PagingOptions 15, 30, 50  #-ScrollX -ScrollY -ScrollSizeY 300
    }
    New-HTMLTab -TabName "Msol" -TabHeading $ReportTitleDate -IconBrands microsoft {
        New-HTMLTable -DataTable $O365UsersTable -HideFooter -DisableResponsiveTable -PagingOptions 15, 30, 50  #-ScrollX -ScrollY -ScrollSizeY 300
    }
} -ShowHTML -Online

@PrzemyslawKlys PrzemyslawKlys added the bug Something isn't working label Feb 2, 2021
@PrzemyslawKlys
Copy link
Member

Fixed - based on discussion in: https://datatables.net/forums/discussion/comment/186568#Comment_186568

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants