material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Increase the font in the Pagination component ...

Open anand-swaminathan opened this issue 7 years ago • 2 comments

I tried to use component overriding for Pagination as follows : <MaterialTable components={{ Pagination: props => (

), }}

The intent was that the text "Rows per page" and the text "1-20 of 500" (for example) would be in font size of 14. I could not get this to work. Is this doable ?

anand-swaminathan avatar Jan 09 '19 19:01 anand-swaminathan

Hi @anand-swaminathan, Try this:

// import { TablePagination } from '@material-ui/core';

<MaterialTable
          columns={[
            { title: 'Adı', field: 'name' },
            { title: 'Soyadı', field: 'surname' },
            { title: 'Doğum Yılı', field: 'birthYear', type: 'numeric' },
            { title: 'Doğum Yeri', field: 'birthCity', lookup: { 34: 'İstanbul', 63: 'Şanlıurfa' } }
          ]}
          data={this.state.data}
          title="Demo Title"
          components={{
            Pagination: props => (
              <TablePagination
                {...props}
                labelRowsPerPage={<div style={{fontSize: 14}}>{props.labelRowsPerPage}</div>}
                labelDisplayedRows={row => <div style={{fontSize: 14}}>{props.labelDisplayedRows(row)}</div>}
                SelectProps={{
                  style:{
                    fontSize: 14
                  }
                }}
              />
            )
          }}
        />

mbrn avatar Jan 10 '19 06:01 mbrn

This worked well. Thanks so much

aswamina avatar Jan 11 '19 03:01 aswamina