Attributes for table rows
It's pretty common to have a table of items that the user can click / select - which means having styles / click handlers on the rows. You can sort of emulate this by putting identical els in each cell with styles and click handlers on them. However, mouseOver decorators don't work as you would want, since they will only apply to the cell rather than the row.
Suggestion:
Element.tableWithRowAttributes []
{ data = [...]
, columns = [...]
, rowAttributes = \item -> [ mouseOver [ Background.color lightGrey ] etc...]
}
As a side note, Element.indexedTable seems a little redundant, as you could just use List.indexedMap Tuple.pair on the data, and when you use Dict.toList you already get it "for free"
+1 to this feature, I really think this is very useful, I don't know what @mdgriffith thinks about this, but I could give a shot ( I haven't started to do because I read the Contributing.md :) )
What's the current state of this issue? @mdgriffith is the present feature request consistent with (1) the architecture and (2) technically feasible?
I'm also interested in this feature and I would like to hear about any progress. If you look at any popular css framework (bootstrap, bulma,..) the basic thing they offer is highlighting the current row for example.
Also looking for a solution to this. I would love to have alternating row colors along with a click event for the entire row rather than one for each individual cell.
I'm interested in this as well. I maintain a lot of reporting tables for a personal project and need to be able to format/work with whole rows, not just cells.
I'm trying to add separator lines to tables, I'd also love to have this feature!
I came here looking for alternating row colors and ultimately found this little CSS trick that solves my problem:
tr:nth-child(even) {background: #CCC}
tr:nth-child(odd) {background: #FFF}