diff --git a/packages/grafana-ui/src/components/Table/TableCell.tsx b/packages/grafana-ui/src/components/Table/TableCell.tsx index 7177142c122..b0c622288eb 100644 --- a/packages/grafana-ui/src/components/Table/TableCell.tsx +++ b/packages/grafana-ui/src/components/Table/TableCell.tsx @@ -28,11 +28,6 @@ export const TableCell: FC = ({ cell, tableStyles, onCellFilterAdded, col let innerWidth = ((cell.column.width as number) ?? 24) - tableStyles.cellPadding * 2; - // last child sometimes have extra padding if there is a non overlay scrollbar - if (columnIndex === columnCount - 1) { - innerWidth -= tableStyles.lastChildExtraPadding; - } - return cell.render('Cell', { field, tableStyles, diff --git a/packages/grafana-ui/src/components/Table/styles.ts b/packages/grafana-ui/src/components/Table/styles.ts index 7ee588594f1..50c17b669f7 100644 --- a/packages/grafana-ui/src/components/Table/styles.ts +++ b/packages/grafana-ui/src/components/Table/styles.ts @@ -2,8 +2,6 @@ import { css, CSSObject } from '@emotion/css'; import { GrafanaTheme2 } from '@grafana/data'; -import { getScrollbarWidth } from '../../utils'; - export const getTableStyles = (theme: GrafanaTheme2) => { const { colors } = theme; const headerBg = theme.colors.background.secondary; @@ -14,7 +12,6 @@ export const getTableStyles = (theme: GrafanaTheme2) => { const bodyFontSize = 14; const cellHeight = cellPadding * 2 + bodyFontSize * lineHeight; const rowHoverBg = theme.colors.emphasize(theme.colors.background.primary, 0.03); - const lastChildExtraPadding = Math.max(getScrollbarWidth(), cellPadding); const buildCellContainerStyle = (color?: string, background?: string, overflowOnHover?: boolean) => { const cellActionsOverflow: CSSObject = { @@ -50,7 +47,6 @@ export const getTableStyles = (theme: GrafanaTheme2) => { &:last-child:not(:only-child) { border-right: none; - padding-right: ${lastChildExtraPadding}px; } &:hover { @@ -98,7 +94,6 @@ export const getTableStyles = (theme: GrafanaTheme2) => { cellHeight, buildCellContainerStyle, cellPadding, - lastChildExtraPadding, cellHeightInner: bodyFontSize * lineHeight, rowHeight: cellHeight + 2, table: css`