| Server IP : 54.94.228.101 / Your IP : 172.28.1.13 Web Server : Apache System : Linux ip-172-28-29-189 6.5.0-1014-aws #14~22.04.1-Ubuntu SMP Thu Feb 15 15:27:06 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.2.34-43+ubuntu22.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/vinumday2_0/vendor/maatwebsite/excel/docs/blade/ |
Upload File : |
# Styling sheets
### General styling
If you want to change the general styling of your sheet (not cell or range specific), you can use the `->setStyle()` method or any of the other setters which can be found inside the export documentation.
// Font family
$sheet->setFontFamily('Comic Sans MS');
// Set font with ->setStyle()`
$sheet->setStyle(array(
'font' => array(
'name' => 'Calibri',
'size' => 12,
'bold' => true
)
));
### Styling with PHPExcel methods
It's possible to style the sheets and specific cells with help of PHPExcel methods. This package includes a lot of shortcuts (see export documentation), but also always the use of the native methods.
// Set background color for a specific cell
$sheet->getStyle('A1')->applyFromArray(array(
'fill' => array(
'type' => PHPExcel_Style_Fill::FILL_SOLID,
'color' => array('rgb' => 'FF0000')
)
));
### Using HTML tags
Most of the HTML tags are supported.
<html>
<!-- Headings -->
<td><h1>Big title</h1></td>
<!-- Bold -->
<td><b>Bold cell</b></td>
<td><strong>Bold cell</strong></td>
<!-- Italic -->
<td><i>Italic cell</i></td>
<!-- Images -->
<td><img src="img.jpg" /></td>
</html>
> Inside the `view.php` config you can change how these tags will be interpreted by Excel by default.
### Using HTML attributes
Some of the basic styling can be done with HTML attributes.
<html>
<!-- Horizontal alignment -->
<td align="right">Big title</td>
<!-- Vertical alignment -->
<td valign="middle">Bold cell</td>
<!-- Rowspan -->
<td rowspan="3">Bold cell</td>
<!-- Colspan -->
<td colspan="6">Italic cell</td>
<!-- Width -->
<td width="100">Cell with width of 100</td>
<!-- Height -->
<td height="100">Cell with height of 100</td>
</html>
### Styling through inline-styles
It's possible to use inline styles inside your view files. Most of the general styles are supported.
<html>
<!-- Cell with black background -->
<td style="background-color: #000000;">Cell</td>
</html>
> Inside the reference guide you can find a list of supported styles.
### Styling through external CSS file
Styling can be done through an external CSS file.
External css file:
#cell {
background-color: #000000;
color: #ffffff;
}
.cell {
background-color: #000000;
color: #ffffff;
}
tr td {
background-color: #ffffff;
}
tr > td {
border-bottom: 1px solid #000000;
}
Table:
<html>
{{ HTML::style('css/table.css') }}
<!-- Cell styled with class -->
<td class="cell">Cell</td>
<!-- Cell styled with ID -->
<td id="cell">Cell</td>
</html>
> Inside the reference guide you can find a list of supported styles.
> It's advised to include `<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />` into the view to fix problems with UTF-8 encoding.