mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Last Table Column Not Centered (#56047)
Co-authored-by: gitstart <gitstart@gitstart.com> Co-authored-by: gitstart <gitstart@users.noreply.github.com> Co-authored-by: Nitesh Singh <nitesh.singh@gitstart.dev> Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com> Co-authored-by: Rubens Rafael <70234898+RubensRafael@users.noreply.github.com> Co-authored-by: RubensRafael <rubensrafael2@live.com> Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com> Co-authored-by: Matheus Muniz <87545749+matheusmuniz03@users.noreply.github.com> Co-authored-by: Matheus Muniz <matheusmuniz100@hotmail.com> Co-authored-by: Matheus Benini Ferreira <88898100+MatheusBeniniF@users.noreply.github.com> Co-authored-by: Murilo Amaral <87545137+MuriloAmarals@users.noreply.github.com> Co-authored-by: gitstart <gitstart@users.noreply.github.com> Co-authored-by: gitstart <gitstart@gitstart.com> Co-authored-by: Nitesh Singh <nitesh.singh@gitstart.dev> Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com> Co-authored-by: Rubens Rafael <70234898+RubensRafael@users.noreply.github.com> Co-authored-by: RubensRafael <rubensrafael2@live.com> Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com> Co-authored-by: Matheus Muniz <87545749+matheusmuniz03@users.noreply.github.com> Co-authored-by: Matheus Muniz <matheusmuniz100@hotmail.com> Co-authored-by: Matheus Benini Ferreira <88898100+MatheusBeniniF@users.noreply.github.com> Co-authored-by: Murilo Amaral <87545137+MuriloAmarals@users.noreply.github.com>
This commit is contained in:
parent
b047316ef4
commit
4ecc9f42ac
@ -28,11 +28,6 @@ export const TableCell: FC<Props> = ({ 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,
|
||||
|
@ -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`
|
||||
|
Loading…
Reference in New Issue
Block a user