Skip to content

Mark rows as even or odd for styling purposes - #1190

Merged
kpfefferle merged 1 commit into
masterfrom
kpfefferle/rt-3407-even-odd-rows
Aug 19, 2025
Merged

kpfefferle merged 1 commit into
masterfrom
kpfefferle/rt-3407-even-odd-rows

Conversation

@kpfefferle

Copy link
Copy Markdown
Member
  • Addepar's new visual look includes zebra-striping tables
  • Since ember-table uses vertical-collection to occlude rows during scroll, this can't be reliably done with CSS selectors like :nth-child(even) or :nth-child(odd)
  • A number of Addepar teams have manually added class="{{if (eq (modulus-of body.rowMeta.index 2) 0) 'is-even' 'is-odd'}}" to their ember-table row component calls to add stable row class names that indicate which rows have an even index vs an odd index
  • This PR brings this capability into ember-table itself so that we (and other consumers) don't have to repeat this pattern over and over in order to give ember-tables a zebra stripe styling

@kpfefferle
kpfefferle force-pushed the kpfefferle/rt-3407-even-odd-rows branch from dbf8a78 to 0f42926 Compare August 19, 2025 21:04
@kpfefferle

Copy link
Copy Markdown
Member Author

This same test failure seems to also be happening on master, so I don't believe it has anything to do with this PR 🤔

@DanMonroe DanMonroe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks Kevin. This will clean up some code for us.

@kpfefferle
kpfefferle merged commit f729f26 into master Aug 19, 2025
15 of 18 checks passed
@kpfefferle
kpfefferle deleted the kpfefferle/rt-3407-even-odd-rows branch August 19, 2025 21:52
@mixonic

mixonic commented Feb 27, 2026

Copy link
Copy Markdown
Member

This is included in 6.0.0-11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants