Ron van Asseldonk
Ron van Asseldonk

Reputation: 1345

How can I apply borders to a specific cell with laravel excel?

I've been working with Laravel Excel for a few weeks now and I like it alot. But I can't apply borders to a specific cell.

This is my code:

$sheet->cell('A1', function($cell){
    $cell->setBorder('solid','solid','solid','solid');
});

Some background info about the cell 'A1':

The sheet variable is a valid Excelsheet and I can add data to this.

Did I make a mistake somewhere or is this a known bug for Laravel Excel?

Thanks for your time!

Upvotes: 1

Views: 12728

Answers (2)

shankshera
shankshera

Reputation: 985

This is working for me

$sheet->cell('A1', function($cell){
    $cell->setBorder('thin','thin','thin','thin');
});

Please refer to this documentation, there is no solid option. Yes, maybe there are some typos in that laravel-excel example.

Upvotes: 2

hhsadiq
hhsadiq

Reputation: 2953

Try this

$sheet->setBorder('A1', 'solid');

Upvotes: 0

Related Questions