Got something sorted…
- From PowerShell Universal | Components | Marketplace | Browse I found ‘UniversalDashboard.Style Easily create stylesheets on the fly.’
- I clicked ‘Install’ and waited, I then saw an error 400 modal display (error downloading?). I tried ‘Install-Module UniversalDashboard.Style’ in a PowerShell session on the server running PowerShell Universal too - maybe this worked? It downloaded the module.
- I grabbed the button styling example from https://marketplace.universaldashboard.io/Dashboard/UniversalDashboard.Style and added it to my dashboard script, it didn’t display
- I restarted Universal.Server - I’m running from IIS so stopped and started the website
- I logged back in to PowerShell Universal and at Components I now saw: UniversalDashboard.Style 1.0.0 C:\ProgramData\PowerShellUniversal\Dashboard\Components\UniversalDashboard.Style\1.0.0\UniversalDashboard.Style.psd1
- I stopped and started the dashboard, but the example button still didn’t display
- In the .ps1 script for the dashboard, I added: Import-Module ‘C:\ProgramData\PowerShellUniversal\Dashboard\Components\UniversalDashboard.Style\1.0.0\UniversalDashboard.Style.psm1’
- I stopped and started the dashboard, AND SUCCESS! the css styled button displays.
- I then wrapped by New-UDTable with a New-UDStyle like…
New-UDStyle -Style '
New-UDTable -Data $session:getroundcards -Columns $Columns -Sort -Export -Search
With the “.MuiTableCell-root” section enabling me to remove the padding from the table! yes!
So I just thought I’d reply with my experience in case it may help others out. It may have been an easy/basic challenge to achieve, but knowing to get UDStyle from the marketplace and then having to import that module wasn’t so clear. (The above may not be the best way to do this, if not please sing out)
Now I need to work out how to adjust the widths of each column individually
And would it be possible to remove the footer (with rows per page options) and set the height / auto-height based upon number of rows. Just trying to get a single row/grid output.