fix: pivot-table-fixed (#1360)

This commit is contained in:
Lyndsi Kay Williams 2021-09-22 13:36:09 -05:00 committed by Yongjie Zhao
parent 055d9f8e42
commit 43526009f3
3 changed files with 6 additions and 2 deletions

View File

@ -110,6 +110,10 @@ function PivotTable(element, props) {
});
});
$container.find('table').each(function fullWidth() {
this.style = 'width: 100%';
});
if (numGroups === 1) {
// When there is only 1 group by column,
// we use the DataTable plugin to make the header fixed.

View File

@ -43,7 +43,7 @@ const Styles = styled.div<PivotTableStylesProps>`
${({ height, width, margin }) => `
margin: ${margin}px;
height: ${height - margin * 2}px;
width: ${width - margin * 2}px;
width: ${typeof width === 'string' ? parseInt(width, 10) : width - margin * 2}px;
`}
`;

View File

@ -31,7 +31,7 @@ import { ColorFormatters } from '@superset-ui/chart-controls';
export interface PivotTableStylesProps {
height: number;
width: number;
width: number | string;
margin: number;
}