PSWriteHTML icon indicating copy to clipboard operation
PSWriteHTML copied to clipboard

I need help with New-HTMLTable and New-TableRowGrouping

Open gglgiggles opened this issue 4 years ago • 3 comments

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

image

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.

image

gglgiggles avatar Aug 24 '21 11:08 gglgiggles

I am not sure if this is possible:

  1. Some docs for row grouping -> https://datatables.net/examples/advanced_init/row_grouping.html - not everything is implemented what is possible
  2. 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.

PrzemyslawKlys avatar Aug 24 '21 11:08 PrzemyslawKlys

Have had a chance to look at the documentation for the row grouping but for issue 2, the above did the trick. Thanks

gglgiggles avatar Aug 24 '21 21:08 gglgiggles

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!

raoue avatar Mar 04 '22 18:03 raoue