This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > FrontPage Programming > May 2006 > Printing a Table





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Printing a Table
Jacques

2006-05-26, 6:58 pm

I did a javascript to create a dynamic table. I used window.print() to print
the whole page. But I would prefer to print only the table, how can I do that?
Trevor L.

2006-05-27, 3:40 am

Jacques wrote:
> I did a javascript to create a dynamic table. I used window.print()
> to print the whole page. But I would prefer to print only the table,
> how can I do that?


Use a special CSS file, say print.css, with these contents:
body {color: black; background-color: white ; background-image: url("");}
..hidden {visibility: hidden ;}

Actually the body spec can be anything, but I use this to remove any
backgrounds.

Link to it in the <head> section by:
<link rel="stylesheet" type="text/css" media="print" href="print.css" />

Place everything *except* the table in a <div> (or <div>'s)
<div class="hidden">

Voila !
Only the table will be printed
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews