/    Sign up×
Community /Pin to ProfileBookmark

printing only a form

hi

i need to print only a part of my web site, that is a table with a form on it, i don need to print anithing else, no decoration no nothing anly that part.

can you tell me how to do it. I have seen some things, but i dont know where to put them.

thanks.

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@Compguy_PeteJun 24.2006 — You'll wanna do something like this... Lets say for this object you dont want to show is in a div tag named: navigation

<link href="style-prn.css" rel="stylesheet" type="text/css" media="print">

<link href="style.css" rel="stylesheet" type="text/css" media="screen">

[/QUOTE]

Inside that Style-prn.css file your going to have

#navigation {

display: none;

}
[/QUOTE]


Inside your style.css you'd have this type of coding (only for example!)

#navigation{

width:155px;

text-align:left;

float:left;

margin-left: 2px;

vertical-align: top;

background-color: #CCCCCC;

font-family: Arial, Helvetica, sans-serif;

font-size: 21px;

}
[/QUOTE]
Copy linkTweet thisAlerts:
@FangJun 24.2006 — Use [I]@media print[/I] or link a [I]media="print"[/I] css

http://meyerweb.com/eric/articles/webrev/200001.html
Copy linkTweet thisAlerts:
@P099authorJun 28.2006 — i tried what Compguy Pete told me, but it still print all the page

i put this on top

[CODE]<link href="style-prn.css" rel="stylesheet" type="text/css" media="print">
<link href="style.css" rel="stylesheet" type="text/css" media="screen">[/CODE]


on style.css i tried this

[CODE]#navigation{
background:#FFFFFF;
width:624px;
height:400px;
}[/CODE]


the height and width are the size of the table i wanna print who has the form on it.

and on style-prn.css i tried this, with some other combinations, including what pete told me

[CODE]#navigation {
height:500;
width:624;
display:table
} [/CODE]


and nothing, it prints the same page. all the page.

i put my div tag here

[CODE]<td width="10">&nbsp;</td>
<td width="624"><div align="justify" class="Estilo1">
<form name="form" onSubmit="return validar(this)" method="post" action="procesar-visa.php">
[B]<div id="navigation">[/B]
<table cellspacing="0" class="Estilo1">
<tr>
<td width="400">&nbsp;</td>
<td width="624">&nbsp;</td>
</tr>
<tr>
<td>Nombres:</td>
<td width="169"><input name="nombre" type="text"></td>
</tr>[/CODE]


that might give you and idea. If you can help me with this ? Thanks

i olse read the page you left me but i didn´t understand a lot and some only work only on IE.

Thanks
Copy linkTweet thisAlerts:
@KDLAJun 28.2006 — You need to assign div ids to the sections you DO NOT want to print, place these in the print stylesheet, with the display: none setting, as Pete showed you.

FYI - If you're using nested tables, you'll need to apply those ids to the cells <td>, rather than divs <div>, else the cell will remain. Also, you need to move your widths and heights, and whatever else is in those <td> tags to your CSS. The stylesheet will not override HTML code like:<i>
</i>&lt;td [B]width="400"[/B]&gt;&amp;nbsp;&lt;/td&gt;
&lt;td [B]width="624"[/B]&gt;&amp;nbsp;&lt;/td&gt;

(Actually, you should get rid of the nested tables, but that's my opinion.)
×

Success!

Help @P099 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...