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:
GitStart 2022-10-14 18:25:40 +08:00 committed by GitHub
parent b047316ef4
commit 4ecc9f42ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 10 deletions

View File

@ -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,

View File

@ -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`