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.

Comments

level02’s picture

Status: Active » Postponed (maintainer needs more info)

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.

aren cambre’s picture

I mean in a generic table-based view that shows multiple nodes.

level02’s picture

Can you post a picture?

aren cambre’s picture

StatusFileSize
new103.22 KB

Attached. Running Views 6.x-2.0-rc1.

level02’s picture

Category: bug » support
Priority: Normal » Minor
Status: Postponed (maintainer needs more info) » Closed (works as designed)

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.

aren cambre’s picture

Category: support » bug
Priority: Minor » Normal
Status: Closed (works as designed) » Active
StatusFileSize
new99.64 KB
new111.03 KB

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.

level02’s picture

Category: bug » feature
Status: Active » Needs review
StatusFileSize
new541 bytes

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.active and tr.odd td.active to 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.active and thead th. It also adds a border-bottom to tr.odd td, tr.even td.

Remember to save the theme configuration settings after changing style.css to see the changes.

aren cambre’s picture

Category: feature » bug

Thanks. I prefer this to be a bug report because this is about broken code (alternating colors), not a "nice to have" feature.

Jeff Burnz’s picture

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.