In my React Application (using semanticUI), I have several components rendered in a view, but when users want to print the page (e.g. by pressing Ctrl+P on the browser) I want only one part to be printable
for instance, if this is a screenshot of what user sees, the green area should be shown on print overview when the browser print is triggered.
So far I have in the SCSS file
@media print{
.no-print, .no-print *{ display: none !important; }
}
which adding to unwanted components makes them disappear but yet got blank space in print area and the green part is not filling the page, also if this green part is scrollable and should fit into several pages I just see one page (one A4 paper containing what I see on screen)
having
@media print {
.print-content {
display: block;
width: 100%;
height: 100%;
page-break-after: always;
overflow: visible;
}
}
did not work yet get the same printable view
this is the code for this screenshot
import React from 'react'
import { Grid, Image } from 'semantic-ui-react'
const GridExampleCelled = () => (
<Grid celled>
{/*another Grid.Row*/}
<Grid.Row>
<Grid.Column width={3}>
<Image src='/images/wireframe/image.png' />
</Grid.Column>
<Grid.Column width={10}> /* This should be the component to print */
<p> EveryThing Wrapped in this Grid should be printed </p>
</Grid.Column>
<Grid.Column width={3}>
<Image src='/images/wireframe/image.png' />
</Grid.Column>
</Grid.Row>
</Grid>
)
export default GridExampleCelled