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

ADD: Allow extra attributes to table columns #922

Conversation

bernhardh
Copy link
Contributor

@bernhardh bernhardh commented Dec 18, 2021

This pull request is to allow extra attributes - especially classes - to table columns.

Usecase: If you link a column with url method right now, nothing shows you, that the cell is linked (except the cursor). With this commit you can style it like a link:

Tables\Columns\TextColumn::make("owner.name")
    ->withAttributes(["class" => "text-green-500"])
    ->url(fn ($record): string => route("...")),

@danharrin danharrin added enhancement New feature or request pending review labels Dec 19, 2021
@danharrin danharrin merged commit 7e87091 into filamentphp:2.x Dec 19, 2021
@danharrin
Copy link
Member

Thanks! I had to add the extraAttributes() method to columns.

@bernhardh bernhardh deleted the feature/allow-extra-attributes-on-table-columns branch December 4, 2023 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pending review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants