Set up form for printing

2

I created a form where, when it is filled, it should be printed. However, when I go to print, it comes out completely unformatted.

Does anyone know how I can make the print output formatted?

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

ButtonHTML:

<inputclass="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>
    
asked by anonymous 29.08.2016 / 13:57

1 answer

1

Use CSS to format the print through a specific file for formatting or mark the changes for printing with @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

    
29.08.2016 / 15:49