Material-table: Hide or remove the bottom border of last row

Created on 18 Jul 2020  路  2Comments  路  Source: mbrn/material-table

  • Need to hide the bottom border.

    Hi, all.

    Is there any style property I can use to hide or remove the table's bottom border only?

    I searched for a lot. But haven't found a right way to do it.

    Does anyone have any suggestions?
    Thanks in advance.

question

Most helpful comment

@chaofan232, try this:

const useStyles = makeStyles({
  table: {
    "& tbody tr:last-child td": {
      border: 0
    }
  }
});

const MyComponent= () => {
  const classes = useStyles();
  ...

  return (
    <MaterialTable
      ...
      components={{
        Container: props => <Paper {...props} className={classes.table} />
      }}
    />
  );
};

All 2 comments

@chaofan232, try this:

const useStyles = makeStyles({
  table: {
    "& tbody tr:last-child td": {
      border: 0
    }
  }
});

const MyComponent= () => {
  const classes = useStyles();
  ...

  return (
    <MaterialTable
      ...
      components={{
        Container: props => <Paper {...props} className={classes.table} />
      }}
    />
  );
};

@VLRTroll , thank you so much. This works perfectly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

slevy85 picture slevy85  路  3Comments

KKrisu picture KKrisu  路  3Comments

bohrsty picture bohrsty  路  3Comments

Mihier-Roy picture Mihier-Roy  路  3Comments

ModPhoenix picture ModPhoenix  路  3Comments