Skip to content

Adding class to specific column header in v2? #801

Closed Answered by emilsrits
emilsrits asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, I figured it out with setThAttributes:

public function configure(): void
{
    $this->setPrimaryKey('id')
        ->setAdditionalSelects(['*'])
        ->setThAttributes(function (Column $column) {
            if ($column->getTitle() === 'Actions') {
                return [
                    'class' => 'text-end',
                ];
            }

            return [];
        });
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ntpnhan
Comment options

Answer selected by emilsrits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants