简体   繁体   English

如何在CodeIgniter中打印搜索结果?

[英]How to print a search result in CodeIgniter?

I am using PHP and CodeIgniter. 我正在使用PHP和CodeIgniter。 I have a page that containing the data from database and \\ search option in that screen. 我有一个页面,该页面包含该屏幕中来自数据库和\\搜索选项的数据。 I'm designing the new page for print the same data. 我正在设计用于打印相同数据的新页面。 How can I link the new page for print? 如何链接新页面进行打印? For example: 例如:

View page: 查看页面:

在此处输入图片说明

I want to print the display result in another new page, like: 我想在另一个新页面中打印显示结果,例如:

在此处输入图片说明

How to get the result from screen 1 to screen 2? 如何从屏幕1到屏幕2获得结果?

I think you want to redesign (alter) the presentation when you are printing that page/content and in this case (if really this is the case) you may add a different css styles for print media , for example: 我认为您在打印该页面/内容时想重新设计(更改)演示文稿,在这种情况下(如果确实如此),可以为print media添加不同的css styles ,例如:

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

if you add another CSS file and style those elements differently in that CSS file then those styles would be applied only when the pages is being printed, so you may add in that CSS: 如果您添加另一个CSS文件并在该CSS文件中以不同的方式设置这些元素的样式,则仅在打印页面时才应用这些样式,因此您可以在该CSS中添加:

#search_bar_at_top {
    display:none; /*Hide the search bar*/
}

Or using in the same CSS file using media print : 或使用media print在同一CSS文件中使用:

@media print{
    #search_bar_at_top {
        display:none; /*Hide the search bar*/
    }
}

Check more on MDN and other helpful articles: 查看有关MDN和其他有用文章的更多信息:

  1. How To Set Up A Print Style Sheet 如何设置打印样式表

  2. Print Different 打印不同

  3. CSS Media Types Create Print-Friendly Pages CSS媒体类型创建打印友好页面

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM