On Thu, Mar 8, 2012 at 6:36 PM, David Thorp
<mailingli...@allaboutabundance.com> wrote:
> I agree, the nested tables are not great, but I hit all sorts of problems 
> trying to do it with divs and floats, and while I had a couple of helpful 
> tips from people on this list about that I haven't got my head quite around 
> them yet.  A couple of people suggested it's not so bad to do it in tables, 
> but I'd still like to do it without them.  So I'll be returning to that 
> particular goal later.
>
> In the meantime, thanks for your demo, although that doesn't really achieve 
> what I'm trying to achieve.  The purpose is for each row of the table to be 
> alternating colors.  It's not just a pretty pattern to sit behind the table.

hmmm...  The background-size property is supported in Chrome and Safari, but
they don't seem to render it as expected.  Firefox and IE9 render it as you
described with the colors accurately aligned with the rows, but Chrome and
Safari don't.

I can't tell exactly why it's happening.  Looking at computed styles in Chrome
shows that the background-size is 1px larger than it should be.  Another
surprise, Firebug doesn't show a computed value for the background-size
property.

I can only guess it's a mathematical precision thing.  Changing the em values
only slightly (from 1.3/2.6 to 1.2/2.4) corrects the problem in Safari and
Chrome.  Look again:

http://www.ghodmode.com/testing/dthorp/zstripes/

Here's version 2, which should work everywhere necessary, but would require you
to change the image if you changed the row height:

http://www.ghodmode.com/testing/dthorp/zstripes/v2/


> Maybe you're onto something with the CSS3 gradient idea.  Perhaps the ideal 
> solution would be somehow programmatically generating the background "image" 
> to match the row height.  Perhaps I'll look into that.  Any thoughts?

I'll also see if I can come up with a version 3 that uses the CSS3 Gradients.

--
Vince Aggrippino
Ghodmode Development
http://www.ghodmode.com


> David.
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to