PHP/JAVASCRIPT:是否可以在打印机中只打印选定的表?


PHP/JAVASCRIPT: Is it possible to print only the selected table in the printer?

我只是想知道如果我要搜索一个数据,那么将只打印表不包括搜索框和提交按钮。这有可能吗?

是的,不需要PHP或JavaScript,只需要CSS:您提供一个打印样式表隐藏所有元素,除了您想要打印的元素:

@media print {
    /* ...these rules only apply when printing, use them to hide search boxes
       and such... */
}