Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: able to set cell text and background colors #33

Closed
marcrobledo opened this issue May 14, 2021 · 10 comments
Closed

Suggestion: able to set cell text and background colors #33

marcrobledo opened this issue May 14, 2021 · 10 comments

Comments

@marcrobledo
Copy link
Contributor

First of all, thanks for this library, it's what I really was looking for: a lightweight single file library for basic xlsx building in PHP.

There is a little feature that is missing and is a must IMHO: being able to set cell text and background colors.

There could be a bunch of predefined basic colors defined in the internal styles.xml. Then user could just type:
['My label', '<red>My value</red>']
while adding cells to the array.

@NeuwenWolf
Copy link

I'd like to also express that this would be useful.

@marcrobledo
Copy link
Contributor Author

I've made my own little mod for red color, as it was the only I needed. But it should be fairly easy to add more predefined colors.

@NeuwenWolf
Copy link

Is there any chance you'd be willing to share what you've got so far on that front?

@marcrobledo
Copy link
Contributor Author

I can, but it's just a little hack for a single color.
Adding other predefined colors shouldn't be hard. However, as simplexlsxgen is coded, it would be hard to add custom colors. It would need an overhaul in the styles xml building in order to make it possible.

@shuchkin are you interested on this?

@shuchkin
Copy link
Owner

shuchkin commented Jun 1, 2021

class MyXLSXGen extends SimpleXLSXGen {}

@ProjectLinde37
Copy link

class MyXLSXGen extends SimpleXLSXGen {}
Where can we find de class MyXLSXGen ?

@shuchkin
Copy link
Owner

:)
you have to write this class

@shuchkin
Copy link
Owner

current supported formatting
https://github.com/shuchkin/simplexlsxgen#formatting

@mrjemson
Copy link
Contributor

Have added text color capability in my fork and submitted a pull request for the same.
https://github.com/mrjemson/simplexlsxgen

Have done some basic testing with adding fill options also and will add this at a future date.

NB: Great library @shuchkin very elegant.

@mrjemson
Copy link
Contributor

Have also now added background color fill options into above fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants