diff --git a/src/components/Table/Table.module.css b/src/components/Table/Table.module.css index f22c7e39d9..da18ef931b 100644 --- a/src/components/Table/Table.module.css +++ b/src/components/Table/Table.module.css @@ -1,7 +1,3 @@ -.fullwidth { - width: 100%; -} - .fixed { table-layout: fixed; } diff --git a/src/components/Table/Table.test.tsx b/src/components/Table/Table.test.tsx index 080d1e23b3..54d01a56d7 100644 --- a/src/components/Table/Table.test.tsx +++ b/src/components/Table/Table.test.tsx @@ -68,6 +68,12 @@ describe('Table component', () => { expect(getByRole('table')).toHaveClass('usa-table usa-table--compact') }) + it('renders full width table', () => { + const { getByRole } = render({testContent}
) + + expect(getByRole('table')).toHaveClass('usa-table width-full') + }) + it('renders scrollable table', () => { const { queryByTestId } = render({testContent}
) diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx index a171e1fad4..f30158b03b 100644 --- a/src/components/Table/Table.tsx +++ b/src/components/Table/Table.tsx @@ -28,7 +28,7 @@ export const Table = ({ }: TableProps): React.ReactElement => { const classes = classnames('usa-table', { 'usa-table--borderless': !bordered, - [`${styles.fullwidth}`]: fullWidth, + 'width-full': fullWidth, [`${styles.fixed}`]: fixed, 'usa-table--striped': striped, 'usa-table--compact': compact,