styling changes when `-ShowSelection` is used on tables in apps
v. 2026.3.5
I used CoPilot to diagnose the behaviour, save me hunting through styling information!
Just wondering if this was a design choice? I have two tables side by side, with the only difference being that one has the ShowSelection flag. The tables only have a single visible column that contains a UDCard in a `-Render {}` block. There are multiple other hidden columns needed for search/filtering.
When selection is enabled, the table cell class is set to `MuiTableCell-paddingNone`
Without selection, it appears that the class is instead set to `MuiTableCell-paddingDefault`
This is for both table content as well as the header.
This means that the tables now have a different look, so I've had to wrap the second table in a style to override:
New-UDStyle -Style '
.MuiTableCell-paddingDefault {
padding: 0px !important;
}
' -Content {
New-UDCard
}Thanks in advance.
Recommended Answer
Hello,
Thank you for reaching out and for the details!
In the table code I could read, the padding is set by an explicit rule based on the position of the column among the visible ones, and it is not a side effect of the theme or the CSS. The checkbox column gets the checkbox padding, the second visible column gets padding none, and every other column gets the default padding. Hidden columns are not counted.
With -ShowSelection the checkbox column is the first visible column, so your single card column is the second one and gets padding none. Without it, your card column is the first visible column and gets the default padding. That matches the difference you describe, in both the header and the rows. I read this in the last tagged release before yours, and the table code is unchanged on the 2026.3 release branch and on the development branch.
Our development team has looked at it and does not consider it a design choice. They see it as a mismatch in the styles, and they are going to open an issue for it. I will let you know what comes of it.
Best regards,
Alexis Beauparlant
Hello,
Thank you for reaching out and for the details!
In the table code I could read, the padding is set by an explicit rule based on the position of the column among the visible ones, and it is not a side effect of the theme or the CSS. The checkbox column gets the checkbox padding, the second visible column gets padding none, and every other column gets the default padding. Hidden columns are not counted.
With -ShowSelection the checkbox column is the first visible column, so your single card column is the second one and gets padding none. Without it, your card column is the first visible column and gets the default padding. That matches the difference you describe, in both the header and the rows. I read this in the last tagged release before yours, and the table code is unchanged on the 2026.3 release branch and on the development branch.
Our development team has looked at it and does not consider it a design choice. They see it as a mismatch in the styles, and they are going to open an issue for it. I will let you know what comes of it.
Best regards,
Alexis Beauparlant