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 | isCollapsed() | |
function | setCollapsed(value) | |
whether the column is collapsed | ||
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.
|
function getIndex()
function getWidth() / function setWidth(value)
function getGroupLevel()
function isHidden() / function setHidden(value)
function getStyle()
function isCollapsed() / function setCollapsed(value)