adopted-ember-addons / ember-light-table

Lightweight, contextual component based table for Ember
http://adopted-ember-addons.github.io/ember-light-table/
MIT License
311 stars 131 forks source link

Adding CSS classes to thead, tfoot and tbody #492

Open buschtoens opened 7 years ago

buschtoens commented 7 years ago

@fran-worley https://github.com/offirgolan/ember-light-table/issues/99#event-734291228:

Sorry to bump an old issue but I believe this only partially resolves issues marrying up Bootstraps css styles with ember-light-table.

We need to be able to apply styles directly to the 'thead' too ('.thead-default' is just one style example from BS v4). Could the api be harmonized to allow you to add classes directly to table elements (table, thead, tbody etc.).

As a user, I would expect that setting class on {{t.head}}, {{t.body}} and {{t.foot}} set these classes on the rendered <thead>, <tbody> and <tfoot> elements.

I'm not sure, if we can use class as the attribute name here, since it's a magic Component keyword that automatically sets the class HTML attribute for the rendered component element.

fran-worley commented 7 years ago

@buschtoens provided we can come up with a consistent API for adding class names to table elements it wouldn't matter if the method name was different to class.

I think it would be better to choose a new property name as the hacks involved to use class are likely to be messy and some people might wish to apply a class to the ember element wrapper (e.g. to hide it or something similar).

tClass or tableElementClass might work as a name and could replace the tableClassNames property added for #99 as I believe the API should be harmonious across all table elements.

kboucher commented 1 year ago

tClass or tableElementClass might work as a name and could replace the tableClassNames property added for https://github.com/adopted-ember-addons/ember-light-table/issues/99 as I believe the API should be harmonious across all table elements.

Is there any reason not to follow the naming convention adopted with the addition of the tableClassNames property and simply add support for theadClassNames, tbodyClassNames, and tfootClassNames?