Divide text into two div

1

I'm making an invoice in JavaScript, PHP, HTML and CSS and I have a question. The design of the invoice simulates a folio just like desktop text editors do. I've solved that with <page> and CSS.

When the content arrives according to which line creates another page and duplicates some header and footer div, but the article lines continue on page 1 until the end of the days skipping the separation between pages, the foot of page and the header of the next page.

How could I do to define that the text space measures x and when there is another page continue writing on the next page in the space intended for such?

The code that I have that counts the lines and creates the new page is this:

var Infactura_Lineanum = Contarlineas('#Lineas_Infactura'); 
if (Infactura_Lineanum >= 5) {
    ++Infactura_Pagina;
    var Infactura_Lineanum = 0;
    $('#doc_Infactura').append(
        '<page size="A4" id="Pagina'+Infactura_Pagina+'" class="insertarDoc">
        <div id="cabeceradoc">Factura</div><div class="logo"><img src="../Scripts/Imagenes/Empresas/<?=$_SESSION['Empresa_Id'];?>/<?=$_SESSION['Empresa_Logo'];?>" alt="<?=$_SESSION['Empresa_Nombre'];?>" /></div><div class="marca_agua"><img src="../Scripts/Imagenes/Empresas/<?=$_SESSION['Empresa_Id'];?>/<?=$_SESSION['Empresa_MarcaAgua'];?>" alt="<?=$_SESSION['Empresa_Nombre'];?>" />&nbsp;</div><div class="Empresa"><?=$_SESSION['Empresa_Nombre'];?></div><div class="Registromercantil"><?=$_SESSION['Empresa_Registro'];?></div><div id="Infactura_Totales_'+Infactura_Pagina+'">&nbsp;</div><div class="Npagina">Pagina '+Infactura_Pagina+'</div>
        </page>'
    );
    $('#Infactura_Totales_1').appendTo('#Infactura_Totales_'+Infactura_Pagina); 

Here you can see exactly what happens. If you look at the separation between sheets there is text and at the top of the second page you should leave space for the header.

I do not know if it's done with CSS, with jQuery, or with PHP, or how to search the Internet exactly what I need, sure there are a thousand solutions, the only thing I do not know exactly is what I'm looking for.

and another doubt as we are.

With% jQuery% co_, can not I insert line breaks to make the code cleaner while I program?

    
asked by Killpe 26.12.2016 в 12:28
source

1 answer

1

In the end I solved it by simply putting a layer with the necessary space.

When I got to the line that created the new page, I put this:

$('#Lineas_Infactura').append('<div class="Espaciador">&nbsp;</div>');

and problem solved I already have my blank space that I need :) I do not know if it would be the best option and surely there are many more elegant ones, but at the moment it works.

:)

    
answered by 26.12.2016 / 20:17
source