Add feature to get text & background color from inline CSS : td&th#180
Closed
kifni41 wants to merge 4 commits intoPHPOffice:developfrom
Closed
Add feature to get text & background color from inline CSS : td&th#180kifni41 wants to merge 4 commits intoPHPOffice:developfrom
kifni41 wants to merge 4 commits intoPHPOffice:developfrom
Conversation
Add feature to get text & background color from inline css, for td & th
7 tasks
Member
|
I think it would be best to extract your new code into a private method. Also |
Contributor
Author
|
@PowerKiKi that's good idea, i'll update later.. |
update features-cross-reference add samples
PowerKiKi
reviewed
Jun 21, 2017
src/PhpSpreadsheet/Reader/Html.php
Outdated
| $supported_styles = ['background-color', 'color']; | ||
|
|
||
| // add color styles (background & text) from dom element,currently support : td & th, using ONLY inline css style with RGB color | ||
| if (isset($attributeArray['style'])) { |
Member
There was a problem hiding this comment.
I think we can return early here to avoid too many nested blocks:
if (!isset($attributeArray['style'])) {
return;
}
Member
|
Thanks for the contribution |
Contributor
Author
|
you're welcome, i hope it'll be useful for others and i can contribute more in the future... |
BlackyTay
pushed a commit
to BlackyTay/PhpSpreadsheet
that referenced
this pull request
Aug 8, 2025
…td` and `th` element Closes PHPOffice#180
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is:
Checklist:
What does it change?
I'm not sure if others need this feature, but this feature is quite handy for me and my team to directly generate excel file from html text, usually our client want specific coloring for the excel file and usually we already have the html for that.
This is limited for inline css inside and tag.