PSWriteHTML
PSWriteHTML copied to clipboard
I need help with New-HTMLTable and New-TableRowGrouping
Discussed in https://github.com/EvotecIT/PSWriteHTML/discussions/266
Originally posted by gglgiggles August 19, 2021 I have the following code that almost looks like I want.
New-HTML -TitleText $Title -Online -FilePath $PSScriptRoot\qualifiers.htm -Temporary {
New-HTMLSection -HeaderText 'Source fields For Qualified Converts' {
New-HTMLTable -DataTable $qualified -HideFooter -PagingStyle full_numbers -DisableOrdering -DisableAutoWidthOptimization {
New-HTMLTableColumnOption -ColumnIndex 0 -Hidden $true
New-HTMLTableColumnOption -ColumnIndex 1 -Width 20
New-HTMLTableColumnOption -ColumnIndex 2 -Width 20
New-HTMLTableColumnOption -ColumnIndex 3 -Width 20
New-HTMLTableColumnOption -ColumnIndex 4 -Width 100
New-HTMLTableColumnOption -ColumnIndex 5 -Width 10
New-TableRowGrouping -Name 'client' -Color black -BackgroundColor LightBlue
}
}
} -ShowHTML
Issue 1: When run, I get the groups but would like them all to be collapsed

Issue 2: ColumnIndex 5 can be lengthy and I would like to force this off of the main screen and into something that can be clicked to be shown and have it wrapped as above. The only way, I was able to do that was to EnableScroller, but then the data is not wrapped.

I am not sure if this is possible:
- Some docs for row grouping -> https://datatables.net/examples/advanced_init/row_grouping.html - not everything is implemented what is possible
- You can force some columns to be originally hidden
New-TableHeader -ResponsiveOperations none -Names 'GPONames', 'Objects'
But I don't know if it will work with row grouping.
Have had a chance to look at the documentation for the row grouping but for issue 2, the above did the trick. Thanks
Worked with Row Grouping, even the Grouping Column specified was added as one of the Columns initially hidden but the Group Row still shows that Column's data, excellent!