Okipa / laravel-table

Generate tables from Eloquent models.
MIT License
527 stars 64 forks source link

Allow adding table header class #153

Closed adrianocastro189 closed 8 months ago

adrianocastro189 commented 8 months ago

This PR proposes the introduction of a headerClass property in \Okipa\LaravelTable\Column that allows adding CSS classes to the main <th> elements.

Validating this PR

  1. From a Column object, call its headerClass method passing any string representing a CSS class, example: Column::make('testProperty')->headerClass('my-custom-css-class')
  2. Open the page the table's being rendered and inspect the table's head element
  3. The testProperty column th element has an additional class and it's now like this: class="align-middle test-header-class"
  4. The \Tests\Unit\Bootstrap5\TableColumnsTest::it_can_set_column_header_class() is updated and also serves as an example of its usage

Future considerations