Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Hide duplicate table borders #20809

Merged
merged 14 commits into from
Jun 18, 2020
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