Example:
//Instantiating a Workbook object //Instantiating a Workbook object $workbook = new cells\Workbook(); //Obtaining the reference of the first worksheet $worksheet = $workbook->getWorksheets()->get(0); $style = $workbook->createStyle(); //Setting the background color to Blue $style->setBackgroundColor(cells\Color::getBlue()); //Setting the foreground color to Red $style->setForegroundColor(cells\Color::getRed()); //setting Background Pattern $style->setPattern(cells\BackgroundType::DIAGONAL_STRIPE); //New Style Flag $styleFlag = new cells\StyleFlag(); //Set All Styles $styleFlag->setAll(true); //Get first Column $column = $worksheet->getCells()->getColumns()->get(0); //Apply Style to first Column $column->applyStyle($style, $styleFlag);
Property Getters/Setters Summary | ||
---|---|---|
function | getGroupLevel() | |
Gets the group level of the column. | ||
function | getIndex() | |
Gets the index of this column. | ||
function | isHidden() | |
function | setHidden(value) | |
Indicates whether the column is hidden. | ||
function | getStyle() | |
Gets the style of this column. | ||
function | getWidth() | |
function | setWidth(value) | |
Gets and sets the column width in unit of characters. |
Method Summary | ||
---|---|---|
function | applyStyle(style, flag) | |
Applies formats for a whole column. |
Property Getters/Setters Detail |
---|
getIndex : Number | |
function getIndex() |
getWidth/setWidth : Number | |
function getWidth() / function setWidth(value) |
getGroupLevel : byte | |
function getGroupLevel() |
isHidden/setHidden : boolean | |
function isHidden() / function setHidden(value) |
getStyle : Style | |
function getStyle() |
Method Detail |
---|
applyStyle | |
function applyStyle(style, flag) |
style: Style
- The style object which will be applied.flag: StyleFlag
- Flags which indicates applied formatting properties.