PDA

View Full Version : Help printing _a_part_ of a html (no link, no frames)



Wotan
06-10-2005, 04:38 PM
Hi,
I need help in a task and I thought I could find here the answer,
I need to print a part of a html page, say, the content inside a cell of a table, which has more tables and other tags inside. It is a site made with .Net tec, so the original page is actually an aspx, I don't know if the <link> tag solution will work here, will the server process the aspx before giving it to the printer?, and I would also avoid the solutions with frames or links to the printable version of the page.
Is there any way with scripts to select a html element, say that cell of the table, and order to print its content?
Please, if someone could reply this soon, for I am short in time with this work :P, thanks.

thompa
03-02-2007, 02:34 PM
Hi there,

I know that it is some time since your post - but I was doing a search and came across the entry.

I used the following with success.... until I came to use it again on another page that I am working on!
Surround the area tha you want to print with a <DIV> tag like so:-

<DIV class="print">
</DIV>

I used a 'Print' button on my page like so:-

<input name="print" type="button" onClick="return false;window.print()" value=" Print this " >

Now... this does work one the page that I first used it one - but I am at a loss to determine why it doesn't work on my current page.

Try it on your page and let me know if it works for you!