Added Overflow X to table element

Signed-off-by: Florian BOUILLON <florian.bouillon@delta-wings.net>
This commit is contained in:
Florian Bouillon 2021-05-18 11:09:58 +02:00
parent 7e26c8d5aa
commit be01f386d4
2 changed files with 9 additions and 1 deletions

View File

@ -17,3 +17,6 @@
td td
padding 8px padding 8px
text-align left text-align left
.parent
overflow-x auto

View File

@ -1,15 +1,20 @@
import React from 'react' import React from 'react'
import { buildClassName } from '../Util'
import css from './Table.module.styl' import css from './Table.module.styl'
interface Props { interface Props {
children: React.ReactNode children: React.ReactNode
parentClassName?: string
className?: string
} }
export default class Table extends React.Component<Props> { export default class Table extends React.Component<Props> {
public render = () => ( public render = () => (
<table className={css.table}>{this.props.children}</table> <div className={buildClassName(css.parent, this.props.parentClassName)}>
<table className={buildClassName(css.table, this.props.className)}>{this.props.children}</table>
</div>
) )
} }