Skip to content

Commit

Permalink
fix: pivot-table-fixed (#1360)
Browse files Browse the repository at this point in the history
  • Loading branch information
lyndsiWilliams authored and zhaoyongjie committed Nov 26, 2021
1 parent 055d9f8 commit 4352600
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
`}
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { ColorFormatters } from '@superset-ui/chart-controls';

export interface PivotTableStylesProps {
height: number;
width: number;
width: number | string;
margin: number;
}

Expand Down

0 comments on commit 4352600

Please sign in to comment.