

#1
Posted 06 July 2013 - 06:38 PM
I already searched in this forum and still didn't get the answer. Anybody have idea?
#2
Posted 07 July 2013 - 12:50 AM
td:nth-child(2) div { text-align:right!important; }
That one will make the second column to be right-aligned
#3
Posted 07 July 2013 - 06:41 AM
#4
Posted 07 July 2013 - 06:49 AM
How to make the print preview use our custom css?
#5
Posted 07 July 2013 - 12:20 PM
Unfortunately there is no way to modify print page without extending or editing groceryCRUD library itself.
The quick and dirty way is to find _print_webpage function in /application/libraries/grocery_CRUD.php
The function contains this:
protected function _print_webpage($data) { $string_to_print = "<meta charset=\"utf-8\" /><style type=\"text/css\" > #print-table{ color: #000; background: #fff; font-family: Verdana,Tahoma,Helvetica,sans-serif; font-size: 13px;} #print-table table tr td, #print-table table tr th{ border: 1px solid black; border-bottom: none; border-right: none; padding: 4px 8px 4px 4px} #print-table table{ border-bottom: 1px solid black; border-right: 1px solid black} #print-table table tr th{text-align: left;background: #ddd} #print-table table tr:nth-child(odd){background: #eee} </style>"; $string_to_print .= "<div id='print-table'>"; $string_to_print .= '<table width="100%" cellpadding="0" cellspacing="0" ><tr>'; foreach($data->columns as $column){ $string_to_print .= "<th>".$column->display_as."</th>"; } $string_to_print .= "</tr>"; foreach($data->list as $num_row => $row){ $string_to_print .= "<tr>"; foreach($data->columns as $column){ $string_to_print .= "<td>".$this->_trim_print_string($row->{$column->field_name})."</td>"; } $string_to_print .= "</tr>"; } $string_to_print .= "</table></div>"; echo $string_to_print; die(); }
Add your css there.
WARNING: that gonna applied globally
Also tagged with one or more of these keywords: print
Support →
I have a question →
Bootstrap theme: print and column orderingStarted by Vitor Fonseca, 27 Oct 2020 ![]() |
|
![]() |
||
Support →
Bugs / Issues →
Export and Print Not working with GET and POST DataStarted by abhinay1435, 09 Mar 2019 ![]() |
|
![]() |
||
Support →
Grocery CRUD Enterprise →
Difrences in enterprise editionStarted by wildfandango, 10 Jul 2017 ![]() |
|
![]() |
||
Support →
Grocery CRUD Enterprise →
Creating Custom Header During PrintingStarted by larasmith, 23 Jun 2017 ![]() |
|
![]() |
||
Support →
I have a question →
Print with an specific layoutStarted by Meh, 20 Oct 2016 ![]() |
|
![]() |
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users