Configure form for printing

Asked

Viewed 2,244 times

2

I created a form in which when it is filled out, it should be printed out. However, when I print it all out without formatting.

Can anyone tell me how to make the print out formatted?

And how do I hide the send, print and delete buttons? I used the "None display", but they disappear in the form.

inserir a descrição da imagem aqui

HTML of the buttons:

<input class="envio" type="submit" value="Enviar" name="enviar"/>
<button class="apaga" type="reset" value="Apagar">Apagar</button>

                   <head>
                       <script language="JavaScript">

                           <!-- Begin
                           function varitext(text){
                               text=document
                               print(text)
                           }
                           //  End -->
                       </script>

                   </head>
                   <body>

                   <div class="print">
                       <form>
                           <input name="print" type="button" value="Imprimir"
                                  ONCLICK="varitext()">

                       </form>
                   </DIV>
  • 1

    Post the HTML for us to see.

  • I added the html of the buttons in the question.

1 answer

1


Use the CSS to format the print, via a specific file for formatting or mark the changes for printing with the @media print:

<!-- arquivo CSS específico para impressão -->
<link rel="stylesheet" type="text/css" href="/print.css" media="print" />

or

/* marcar a impressão em arquivo CSS*/

@media print {
}

Read more about CSS formatting for printing

  • It worked great! Thank you!!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.