Skip to content

Commit

Permalink
[docs] Hide duplicate table borders (#20809)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosvega91 authored Jun 18, 2020
1 parent e9007e1 commit 395c933
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 4 deletions.
4 changes: 4 additions & 0 deletions docs/src/pages/components/tables/CustomizedTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ const StyledTableRow = withStyles((theme) => ({
'&:nth-of-type(odd)': {
backgroundColor: theme.palette.action.hover,
},
// hide last border
'&:last-child td, &:last-child th': {
border: 0,
},
},
}))(TableRow);

Expand Down
4 changes: 4 additions & 0 deletions docs/src/pages/components/tables/CustomizedTables.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ const StyledTableRow = withStyles((theme: Theme) =>
'&:nth-of-type(odd)': {
backgroundColor: theme.palette.action.hover,
},
// hide last border
'&:last-child td, &:last-child th': {
border: 0,
},
},
}),
)(TableRow);
Expand Down
7 changes: 6 additions & 1 deletion docs/src/pages/components/tables/DenseTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const useStyles = makeStyles({
table: {
minWidth: 650,
},
hideLastBorder: {
'&:last-child td, &:last-child th': {
border: 0,
},
},
});

function createData(name, calories, fat, carbs, protein) {
Expand Down Expand Up @@ -43,7 +48,7 @@ export default function DenseTable() {
</TableHead>
<TableBody>
{rows.map((row) => (
<TableRow key={row.name}>
<TableRow key={row.name} className={classes.hideLastBorder}>
<TableCell component="th" scope="row">
{row.name}
</TableCell>
Expand Down
7 changes: 6 additions & 1 deletion docs/src/pages/components/tables/DenseTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const useStyles = makeStyles({
table: {
minWidth: 650,
},
hideLastBorder: {
'&:last-child td, &:last-child th': {
border: 0,
},
},
});

function createData(name: string, calories: number, fat: number, carbs: number, protein: number) {
Expand Down Expand Up @@ -43,7 +48,7 @@ export default function DenseTable() {
</TableHead>
<TableBody>
{rows.map((row) => (
<TableRow key={row.name}>
<TableRow key={row.name} className={classes.hideLastBorder}>
<TableCell component="th" scope="row">
{row.name}
</TableCell>
Expand Down
7 changes: 6 additions & 1 deletion docs/src/pages/components/tables/SimpleTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const useStyles = makeStyles({
table: {
minWidth: 650,
},
hideLastBorder: {
'&:last-child td, &:last-child th': {
border: 0,
},
},
});

function createData(name, calories, fat, carbs, protein) {
Expand Down Expand Up @@ -43,7 +48,7 @@ export default function SimpleTable() {
</TableHead>
<TableBody>
{rows.map((row) => (
<TableRow key={row.name}>
<TableRow key={row.name} className={classes.hideLastBorder}>
<TableCell component="th" scope="row">
{row.name}
</TableCell>
Expand Down
7 changes: 6 additions & 1 deletion docs/src/pages/components/tables/SimpleTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const useStyles = makeStyles({
table: {
minWidth: 650,
},
hideLastBorder: {
'&:last-child td, &:last-child th': {
border: 0,
},
},
});

function createData(name: string, calories: number, fat: number, carbs: number, protein: number) {
Expand Down Expand Up @@ -43,7 +48,7 @@ export default function SimpleTable() {
</TableHead>
<TableBody>
{rows.map((row) => (
<TableRow key={row.name}>
<TableRow key={row.name} className={classes.hideLastBorder}>
<TableCell component="th" scope="row">
{row.name}
</TableCell>
Expand Down
3 changes: 3 additions & 0 deletions docs/src/pages/components/tables/SpanningTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const useStyles = makeStyles({
table: {
minWidth: 700,
},
hideBorder: {
border: 0,
},
});

function ccyFormat(num) {
Expand Down
3 changes: 3 additions & 0 deletions docs/src/pages/components/tables/SpanningTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const useStyles = makeStyles({
table: {
minWidth: 700,
},
hideBorder: {
border: 0,
},
});

function ccyFormat(num: number) {
Expand Down

0 comments on commit 395c933

Please sign in to comment.