diff --git a/components/table/table-wrapper.js b/components/table/table-wrapper.js index ccbaceda041..f17c9449cee 100644 --- a/components/table/table-wrapper.js +++ b/components/table/table-wrapper.js @@ -123,10 +123,14 @@ export const tableStyles = css` .d2l-table th:has(d2l-table-col-sort-button:not(:only-child)) d2l-table-col-sort-button { --d2l-table-col-sort-button-width: unset; } - /* has at least one d2l-table-col-sort-button with [nosort], does not have d2l-table-col-sort-button without nosort */ - .d2l-table > * > tr > :has(d2l-table-col-sort-button[nosort]:not(:only-child)):not(:has(d2l-table-col-sort-button:not([nosort]))) :last-child { - padding-inline-end: calc(0.6rem + 18px); - } + } + + /* has at least one d2l-table-col-sort-button with [nosort], does not have d2l-table-col-sort-button without nosort */ + .d2l-table th d2l-table-col-sort-button[nosort] ~ :last-child { + padding-inline-end: calc(0.6rem + 18px); + } + .d2l-table th d2l-table-col-sort-button:not([nosort]) ~ :last-child { + padding-inline-end: unset; } /* border radiuses */