diff --git a/superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx index e52de1450fa6..732ef675c4b2 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx @@ -94,6 +94,11 @@ const StyledTable = styled(Table)<{ } } + .ant-table-row.table-row-highlighted > td.ant-table-cell, + .ant-table-row.table-row-highlighted > td.ant-table-cell.ant-table-cell-row-hover { + background-color: ${theme.colorPrimaryBg}; + } + .ant-table-cell { max-width: 320px; font-feature-settings: 'tnum' 1; @@ -155,6 +160,7 @@ function TableCollection({ columns, rows, loading, + highlightRowId, setSortBy, headerGroups, columnsForWrapText, @@ -272,6 +278,12 @@ function TableCollection({ onPageChange, ]); + const getRowClassName = useCallback( + (record: Record) => + record?.id === highlightRowId ? 'table-row-highlighted' : '', + [highlightRowId], + ); + return ( ({ sortDirections={['ascend', 'descend', 'ascend']} isPaginationSticky={isPaginationSticky} showRowCount={showRowCount} + rowClassName={getRowClassName} components={{ header: { cell: (props: HTMLAttributes) => (