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

Styling rows and header #4

Closed
rap2hpoutre opened this issue Apr 5, 2018 · 8 comments
Closed

Styling rows and header #4

rap2hpoutre opened this issue Apr 5, 2018 · 8 comments
Labels
enhancement New feature or request Hacktoberfest

Comments

@rap2hpoutre
Copy link
Owner

rap2hpoutre commented Apr 5, 2018

First step, just two methods:

  • apply a style to all rows
  • apply a style to header row

Something like styleRows and styleHeader (or maybe rowsStyle and headerStyle...)

See: http://opensource.box.com/spout/docs/#styling-rows

@elminson
Copy link

elminson commented Oct 3, 2018

I will love to work on this :)

@gsailland
Copy link

Please! I really need this!
Any temporary method for column or row or cell styling?
Font color, background or any styling option available?
I need To style header particularly.
And the first row is by default a list of [0-n] cells?
Is it possible to get rid of it?
Is it possible to use Spout functions as it is a dependency of fast-excel?

@rap2hpoutre
Copy link
Owner Author

rap2hpoutre commented Oct 24, 2018

Hi @GregoireSailland. Currently, there is an open PR for this: #61, but I asked for changes in the review.

That being said, if you want more customization, you can fallback to Laravel Excel.

EDIT: @elminson has pushed some changes after the review

@rap2hpoutre
Copy link
Owner Author

Oops. Sorry @elminson I did not saw that some fixes were pushed.

@elminson
Copy link

no problem! just take a few minutes to review it :)

@rap2hpoutre
Copy link
Owner Author

@GregoireSailland Thanks to @elminson work, we added a headerStyle method in FastExcel. You can use it like this:

use Box\Spout\Writer\Style\StyleBuilder;

$style = (new StyleBuilder())
    ->setFontBold()
    ->setBackgroundColor(Color::YELLOW)
    ->build();

(new FastExcel(User::all()))
    ->headerStyle($style)
    ->export('my-file.xlsx');

Reference: http://opensource.box.com/spout/docs/#styling-rows

@gsailland
Copy link

gsailland commented Oct 26, 2018 via email

@rap2hpoutre
Copy link
Owner Author

Available in v0.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Hacktoberfest
Projects
None yet
Development

No branches or pull requests

3 participants