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 custom class to table #495

Merged
merged 2 commits into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@props(['customSecondaryHeader' => false, 'useHeaderAsFooter' => false, 'customFooter' => false])

<div class="{{ $this->responsive ? 'table-responsive' : '' }}">
<table {{ $attributes->except('wire:sortable') }} class="table table-striped">
<table {{ $attributes->except(['wire:sortable','class']) }} class="{{trim($attributes->get("class")) ?: 'table table-striped'}}">
<thead>
<tr>
{{ $head }}
Expand Down
1 change: 1 addition & 0 deletions resources/views/bootstrap-4/includes/table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
:customSecondaryHeader="$secondaryHeader"
:useHeaderAsFooter="$useHeaderAsFooter"
:customFooter="$customFooter"
:class="method_exists($this, 'setTableClass') ? ' ' . $this->setTableClass() : '' "
>
<x-slot name="head">
@if ($reordering)
Expand Down
3 changes: 2 additions & 1 deletion resources/views/bootstrap-5/components/table/table.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
@props(['customSecondaryHeader' => false, 'useHeaderAsFooter' => false, 'customFooter' => false])

<div class="{{ $this->responsive ? 'table-responsive' : '' }}">
<table {{ $attributes->except('wire:sortable') }} class="table table-striped">
@dump($attributes)
<table {{ $attributes->except(['wire:sortable','class']) }} class="{{trim($attributes->get("class")) ?: 'table table-striped'}}">
<thead>
<tr>
{{ $head }}
Expand Down
1 change: 1 addition & 0 deletions resources/views/bootstrap-5/includes/table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
:customSecondaryHeader="$secondaryHeader"
:useHeaderAsFooter="$useHeaderAsFooter"
:customFooter="$customFooter"
:class="method_exists($this, 'setTableClass') ? ' ' . $this->setTableClass() : '' "
>
<x-slot name="head">
@if ($reordering)
Expand Down
2 changes: 1 addition & 1 deletion resources/views/tailwind/components/table/table.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@props(['customSecondaryHeader' => false, 'useHeaderAsFooter' => false, 'customFooter' => false])

<div class="align-middle min-w-full overflow-x-auto shadow overflow-hidden rounded-none md:rounded-lg">
<table {{ $attributes->except('wire:sortable') }} class="min-w-full divide-y divide-gray-200 dark:divide-none">
<table {{ $attributes->except(['wire:sortable','class']) }} class="{{trim($attributes->get("class")) ?: 'min-w-full divide-y divide-gray-200 dark:divide-none'}}">
<thead>
<tr>
{{ $head }}
Expand Down
1 change: 1 addition & 0 deletions resources/views/tailwind/includes/table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
:customSecondaryHeader="$secondaryHeader"
:useHeaderAsFooter="$useHeaderAsFooter"
:customFooter="$customFooter"
:class="method_exists($this, 'setTableClass') ? ' ' . $this->setTableClass() : '' "
>
<x-slot name="head">
@if ($reordering)
Expand Down