-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Description
This is:
- [ ] a bug report
- [x] a feature request
- [x] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
A feature request to support setting built-in styles on a cell when writing to XLSX. We are setting 0 a.k.a Normal for all. Would be good to have ability to set from the list of built-in types e.g. Hyperlink.
setHyperlink
is useful to set the cell's hyperlink but the styling does not reflect it.
Code reference (\PhpSpreadsheet\Reader\Xlsx\Styles.php).
// Cell Styles
if ($this->styleXml->cellStyles) {
foreach ($this->styleXml->cellStyles->cellStyle as $cellStyle) {
if ((int) ($cellStyle['builtinId']) == 0) {
if (isset($this->cellStyles[(int) ($cellStyle['xfId'])])) {
// Set default style
$style = new Style();
$this->readStyle($style, $this->cellStyles[(int) ($cellStyle['xfId'])]);
// normal style, currently not using it for anything
}
}
}
}
Thoughts?
Metadata
Metadata
Assignees
Labels
No labels