8 Replies Latest reply on Jan 19, 2007 6:36 AM by Newsgroup_User

    print

    RyanG24 Level 1
      Hi i have a print page which prints all viewed on the page displayed.

      is it posible to specify only a table to print ie i have 2 table on the page but i only want tp print 1 table


      <body onLoad="window.print();">
        • 1. Re: print
          Fernis Level 3
          Generally, what-you-see-is-what-you-print. Sure, you can have several tables on a page, and if you hide them with CSS, chances are that they aren't printed either.

          So, my answer would be "No."

          You could have a "print" button on the page, opening the page with a url parameter which prevents the second table from appearing.
          • 2. Re: print
            Level 7
            Generally, what-you-see-is-what-you-print. Sure, you can have several
            tables on a page, and if you hide them with CSS, chances are that they
            aren't printed either.

            So, my answer would be "No."

            Actually the answer is yes. You use the media property of the CSS style
            tag. I do this all the time. This allows you to specify different CSS
            for different media.



            <style media="print">
            .hide {display: none}
            </style>


            <table class="hide" ...>
            ...
            </table>

            This table will not print in browsers that understand the CSS standard.
            But will show on the screen as long as you do not hide it with other CSS.


            • 3. Re: print
              Fernis Level 3
              I have to agree, and stand corrected. I was very well aware of the css feature, but never really trusted it works on all browsers. To my surprise, it works on MSIE 6 too, thus it's ok to use it. :)
              • 4. Re: print
                RyanG24 Level 1
                Thanks Ian, works great

                just one more question,

                when i use the print function it adds a header and a footer to the page

                header = page 1 of 1
                footer = www.website.com/page.cfm

                can i also stop these from appearing?

                thanks once again
                • 5. Re: print
                  Level 7
                  can i also stop these from appearing?


                  Sure just add the class="hide" to any container or tag and it will not
                  be printed.

                  You can take this quite a bit farther if you like, resizing elements,
                  changing colors, rearranging layout and more. By defining some CSS in a
                  <script media="all"> (the default if media is not defined) <script
                  media="screen"> and <script media="print"> you can create some very
                  sophisticated layout changes between print and screen.

                  I just wish IE supported more of the CSS standard on this.
                  • 6. Re: print
                    RyanG24 Level 1
                    Hi once again thanks, is there there a website or book i can buy with all this in that you recomend?

                    on the last post the header and footer are printed automatically, they are not displayed on the web page view

                    it adds in
                    header = page 1 of 1
                    footer = www.website.com/page.cfm

                    so how do i use the hide function if i cant actually see it on the webpage?
                    • 7. Re: print
                      Fernis Level 3
                      The headers and footers are most likely the stuff you can see for example in Firefox menu File -> Page Setup. This time I'd say for sure you can't hide those. It's entirely a client-side (browser) configuration issue.
                      • 8. Re: print
                        Level 7
                        Ferris is correct, those are client side browser settings. You have
                        very LITTLE control over those from the sever.

                        There are some activeX controls that supposedly allow you some control
                        over these if you have a Microsoft server and the client is using a
                        Microsoft browser. But I have never bothered with them so do not know
                        anything about their effectiveness and ease of use.