Prev Format |
ExcelExplorer Manual |
Next BackgroundColor |
 |
(ExcelExplorer 4.0)
Returns data alignment.
false EEAlign Align( )
Parameters
- None
Description
Returns EEAlign object containing info about data alignment for this style.
This method can returns FALSE if no alignment information found (in erroneous Excel file only).
It also returns FALSE if file have been explored with option read_align set to FALSE.
So before using any methods of EEAlign object you should always check if this function returns valid object.
Print vertical data alignment for some cell
<?php
$align = $ee->Cell($sheet,$col,$row)->Style()->Align();
if( $align ) {
switch( $align->VAlign() ) {
case EE_VALIGN_TOP:
echo 'Top alignment';
break;
case EE_VALIGN_CENTER:
echo 'Data is centered within a cell or a merged cells area';
break;
case EE_VALIGN_BOTTOM:
echo 'Bottom alignment';
break;
case EE_VALIGN_JUSTIFY:
echo 'Justify data in the cell';
break;
case EE_VALIGN_DISTRIB:
echo 'Distributed';
break;
}
}
?>
|