In Views list, the main (index?) column doesn't have alternating backgrounds
Aren Cambre - July 7, 2008 - 04:00
| Project: | Pixture |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
The main/index columns in a Views-based table has a different background than the other columns but still alternates from row to row.
WIth Pixture, this main/index column has a darker background but fails to alternate.

#1
Can you provide more information?
Do you mean the Views>List page?
Or the Yourview>Basic Settings>Style>Table output?
Both look fine to me and the rows are striped.
#2
I mean in a generic table-based view that shows multiple nodes.
#3
Can you post a picture?
#4
Attached. Running Views 6.x-2.0-rc1.
#5
That helps, thank you. This is happening because in your_view>basic settings>style>table settings ('Defaults: Style options') the default sort order is set to title perhaps. This happens in all themes including Garland. It is because the class 'active' is added to the table cell for that column.
This is default Drupal CSS style found in modules/system/system.css on line 23 that is making this grey background.
td.active {background-color:#DDDDDD;
}
If you change the sort order in your_view>basic settings>style>table settings to none, the table rows will be zebra striped as you wish. You can add a 'Sort criteria' to your view to control the sort order and still get the stripes.
#6
No. If I change back to the default Garland theme, it works. See test site_1218482665305.png.
Sort order already set at None. See Edit view -Definitions- - test site_1218482929439.png.
#7
OK, I was looking at garland with citrus blast and couldn't see the slight change. So this is a feature request to add the css classes
tr.even td.activeandtr.odd td.activeto pixture/style.css.While we're at it lets color the lines as well and get rid of the default system.css grey border on table rows.
Starting on line 44 of pixture/style.css change:
tr.odd td, tr.even td {padding: 0.4em;
}
tr.odd {
background: #fdeaf7;
}
tr.even {
background: #ffffff;
}
to:
tr.odd td, tr.even td {padding: 0.4em;
border-bottom:1px solid #eb5ac3;
}
tr.odd {
background: #fdeaf7;
}
tr.even {
background: #ffffff;
}
tr.even td.active {
background: #fdeaf7;
}
tr.odd td.active {
background: #f9cbed;
}
thead th {
border-bottom: 2px solid #eb5ac3;
}
Attached is a patch for style.css. This patch adds the css classes
tr.even td.active,tr.odd td.activeandthead th. It also adds a border-bottom totr.odd td, tr.even td.Remember to save the theme configuration settings after changing style.css to see the changes.
#8
Thanks. I prefer this to be a bug report because this is about broken code (alternating colors), not a "nice to have" feature.
#9
Has anyone had a chance to test this patch? I haven't had time myself, be good if anyone has tested this can give some feedback, looks like a necessary change to me.