Printing a Table

J

Jacques

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?
 
T

Trevor L.

Jacques said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top