Wednesday, March 30, 2011

Printing in SharePoint 2010 without header, navigation and some other elements

I am pretty sure most of you know about this but perhaps just never thought about it.

Being able to print is one of the most essential requirements of a website. Eventually user want to be able to print the content of a page but perhaps without the header, navigation or some other SharePoint’s element.

This is one simple trick that does the job for me on hiding those elements.

/* Print styles */
@media print
{
    .contentSkip, .s4-notdlg,
    #stuffNotToBePrinted, #s4-ribbonrow, .header, #header
    {
        display: none !important;
    }
}

Just add the above styling to your style sheet (obviously you need to add the things you want to hide to the above css style) and those elements should be hidden.

Have a nice day J

No comments:

Post a Comment