Jump to content

Recommended Posts

Posted

Como assim?

Tu em PHP podes imprimir o que quiseres, independentemente de ser HTML ou não.

“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”

-- Tony Hoare

Posted (edited)

Continuo sem perceber o que queres fazer exactamente, mas aqui vai:

echo "o que quer que queiras imprimir";
Edited by KTachyon

“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”

-- Tony Hoare

Posted (edited)

🙂 nao e isso, imprimir para impressoras.

Eu uso:

<a HREF="javascript:window.print()">Imprimir pagina</a>

mas isto imprime a página inteira, eu quero apenas uma tabela.

Edited by obamaself
Posted

Lol. Nesse contexto já faz mais sentido. Mas essa dúvida não tem nada a haver com PHP.

Aquilo que podes fazer é definir um stylesheet (css) específico para impressão:

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

“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”

-- Tony Hoare

Posted (edited)

Porque o PHP é server-side. Quando a página chega ao browser, já não existe PHP.

Na stylesheet colocas o que quer que seja necessário para que a impressão saia da forma como queres. Se tiveres a página bem estruturada, só tens que esconder as componentes que não queres que sejam imprimidas. Por exemplo:

<div id="header">...</div>
<div id="tabela">...</div>
<div id="coisas">...</div>
<div id="footer">...</div>

print.css:

#header, #coisas, #footer { display: none; }

Apenas a div tabela irá aparecer na impressão.

Edited by brunoais
Passar a usar o geshi

“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”

-- Tony Hoare

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.