When I recently made a View with the table style I was surprised to not find any first and last classes on the first and last rows of the view.
I made a little patch that adds first and last classes - it's useful to for example getting rid of a border on the first or last row to make the view better looking.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | views_table_first_last_classes.patch | 512 bytes | dawehner |
| views_table_first_last_classes.patch | 548 bytes | voxpelli |
Comments
Comment #1
merlinofchaos commentedHmm. I think I'd rather see views-row-first and views-row-last. You never know how 'first' and 'last' will be used by a theme thinking they own the classes.
Comment #2
voxpelli commentedI would disagree - 'first' and 'last' are in my opinion the correct "semantic" classes and if anyone would like to limit a css definition to apply only on a row in a views table they can do so by writing: .views-table tr.first
Also - currently the rows are assigned the classes 'odd' and 'even' and to be consistent with the new classes either these should be changed in to views-row-odd and views-row-even (which I wouldn't like) or 'first' and 'last' shouldn't be prefixed.
Comment #3
merlinofchaos commentedYou have it the other way around. Some theme is probably already going to have:
somewhere, and bam, suddenly their Views will be messed up and some user will have no idea why.
I understand the desire for semantic markup, but semantic markup fails when the left hand doesn't know what any of the left fingers are doing, let alone the right hand, elbow and shoulder. =)
Comment #4
dawehnerUpdated patch.
Comment #5
merlinofchaos commentedCommitted.