<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: style code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 15 May 2008 15:09:23 GMT</pubDate>
    <description>DZone Snippets: style code</description>
    <item>
      <title>Adding style to SVG</title>
      <link>http://snippets.dzone.com/posts/show/5392</link>
      <description>To reference a CSS file within an SVG file refer to the following example code.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;?xml-stylesheet href="styles_austria_1.css" type="text/css"?&gt; &lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Here's what an SVG CSS file looks like.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;.str1 {stroke:#0093DD;stroke-width:16;color:#0093DD}&lt;br /&gt;.str2 {stroke:#0093DD;stroke-width:12}&lt;br /&gt;.str3 {stroke:#0093DD;stroke-width:10}&lt;br /&gt;.str4 {stroke:#0093DD;stroke-width:6}&lt;br /&gt;&lt;br /&gt;.str0 {stroke:#DA251D;stroke-width:55;color:#DA251D}&lt;br /&gt;.str6 {stroke:#BB90BB;stroke-width:44;color:#BB90BB}&lt;br /&gt;.str5 {stroke:#0093DD;stroke-width:4}&lt;br /&gt;.str7 {stroke:#1F1A17;stroke-width:13}&lt;br /&gt;&lt;br /&gt;.fil0 {fill:none}&lt;br /&gt;.fil2 {fill:#1F1A17}&lt;br /&gt;.fil1 {fill:#C4E5FA}&lt;br /&gt;.fil3 {fill:#FFFFFF}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Source: &lt;a href="http://www.carto.net/papers/svg/samples/styles.shtml"&gt;Example for using CSS-Styles&lt;/a&gt; [carto.net]&lt;br /&gt;Reference: &lt;a href="http://www.w3.org/TR/SVG/styling.html#StylingWithCSS"&gt;Styling - SVG 1.1 - 20030114&lt;/a&gt; [w3.org]</description>
      <pubDate>Fri, 18 Apr 2008 21:37:11 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5392</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Adding CSS style to buttons</title>
      <link>http://snippets.dzone.com/posts/show/4957</link>
      <description>This HTML and CSS code shows how to customise buttons in a restful way. Source: http://particletree.com/features/rediscovering-the-button-element/&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;div class="buttons"&gt;&lt;br /&gt;    &lt;button type="submit" class="positive"&gt;&lt;br /&gt;        &lt;img src="/images/icons/tick.png" alt=""/&gt; &lt;br /&gt;        Save&lt;br /&gt;    &lt;/button&gt;&lt;br /&gt;&lt;br /&gt;    &lt;a href="/password/reset/"&gt;&lt;br /&gt;        &lt;img src="/images/icons/textfield_key.png" alt=""/&gt; &lt;br /&gt;        Change Password&lt;br /&gt;    &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;    &lt;a href="#" class="negative"&gt;&lt;br /&gt;        &lt;img src="/images/icons/cross.png" alt=""/&gt;&lt;br /&gt;        Cancel&lt;br /&gt;    &lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;/* BUTTONS */&lt;br /&gt;&lt;br /&gt;.buttons a, .buttons button{&lt;br /&gt;    display:block;&lt;br /&gt;    float:left;&lt;br /&gt;    margin:0 7px 0 0;&lt;br /&gt;    background-color:#f5f5f5;&lt;br /&gt;    border:1px solid #dedede;&lt;br /&gt;    border-top:1px solid #eee;&lt;br /&gt;    border-left:1px solid #eee;&lt;br /&gt;&lt;br /&gt;    font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;&lt;br /&gt;    font-size:100%;&lt;br /&gt;    line-height:130%;&lt;br /&gt;    text-decoration:none;&lt;br /&gt;    font-weight:bold;&lt;br /&gt;    color:#565656;&lt;br /&gt;    cursor:pointer;&lt;br /&gt;    padding:5px 10px 6px 7px; /* Links */&lt;br /&gt;}&lt;br /&gt;.buttons button{&lt;br /&gt;    width:auto;&lt;br /&gt;    overflow:visible;&lt;br /&gt;    padding:4px 10px 3px 7px; /* IE6 */&lt;br /&gt;}&lt;br /&gt;.buttons button[type]{&lt;br /&gt;    padding:5px 10px 5px 7px; /* Firefox */&lt;br /&gt;    line-height:17px; /* Safari */&lt;br /&gt;}&lt;br /&gt;*:first-child+html button[type]{&lt;br /&gt;    padding:4px 10px 3px 7px; /* IE7 */&lt;br /&gt;}&lt;br /&gt;.buttons button img, .buttons a img{&lt;br /&gt;    margin:0 3px -3px 0 !important;&lt;br /&gt;    padding:0;&lt;br /&gt;    border:none;&lt;br /&gt;    width:16px;&lt;br /&gt;    height:16px;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Adding colour to the buttons - Colour is used like a traffic light system, green for go (positive), red for stop (negative, think about this for a moment), and blue which isn't a traffic light (neutral, a miscellaneous item)&lt;br /&gt;&lt;code&gt;&lt;br /&gt;/* STANDARD */&lt;br /&gt;&lt;br /&gt;button:hover, .buttons a:hover{&lt;br /&gt;    background-color:#dff4ff;&lt;br /&gt;    border:1px solid #c2e1ef;&lt;br /&gt;    color:#336699;&lt;br /&gt;}&lt;br /&gt;.buttons a:active{&lt;br /&gt;    background-color:#6299c5;&lt;br /&gt;    border:1px solid #6299c5;&lt;br /&gt;    color:#fff;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/* POSITIVE */&lt;br /&gt;&lt;br /&gt;button.positive, .buttons a.positive{&lt;br /&gt;    color:#529214;&lt;br /&gt;}&lt;br /&gt;.buttons a.positive:hover, button.positive:hover{&lt;br /&gt;    background-color:#E6EFC2;&lt;br /&gt;    border:1px solid #C6D880;&lt;br /&gt;    color:#529214;&lt;br /&gt;}&lt;br /&gt;.buttons a.positive:active{&lt;br /&gt;    background-color:#529214;&lt;br /&gt;    border:1px solid #529214;&lt;br /&gt;    color:#fff;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/* NEGATIVE */&lt;br /&gt;&lt;br /&gt;.buttons a.negative, button.negative{&lt;br /&gt;    color:#d12f19;&lt;br /&gt;}&lt;br /&gt;.buttons a.negative:hover, button.negative:hover{&lt;br /&gt;    background:#fbe3e4;&lt;br /&gt;    border:1px solid #fbc2c4;&lt;br /&gt;    color:#d12f19;&lt;br /&gt;}&lt;br /&gt;.buttons a.negative:active{&lt;br /&gt;    background-color:#d12f19;&lt;br /&gt;    border:1px solid #d12f19;&lt;br /&gt;    color:#fff;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Mon, 07 Jan 2008 22:03:32 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4957</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Unix Console Styler</title>
      <link>http://snippets.dzone.com/posts/show/4822</link>
      <description>This modue can be used to apply many style on Unix* terminals&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# Unix Console Style&lt;br /&gt;# You can use this module to apply a style on the terminal&lt;br /&gt;#&lt;br /&gt;# &lt;b&gt;DON'T WORK ON WINDOWS (Only on Unix* Terminal)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;module UnixConsoleStyle&lt;br /&gt;  # Availables Styles&lt;br /&gt;  STYLE = {&lt;br /&gt;      :default    =&gt;    "\033[0m",&lt;br /&gt;    	# styles&lt;br /&gt;    	:bold       =&gt;    "\033[1m",&lt;br /&gt;    	:underline  =&gt;    "\033[4m",&lt;br /&gt;    	:blink      =&gt;    "\033[5m",&lt;br /&gt;    	:reverse    =&gt;    "\033[7m",&lt;br /&gt;    	:concealed  =&gt;    "\033[8m",&lt;br /&gt;    	# font colors&lt;br /&gt;    	:black      =&gt;    "\033[30m", &lt;br /&gt;    	:red        =&gt;    "\033[31m",&lt;br /&gt;    	:green      =&gt;    "\033[32m",&lt;br /&gt;    	:yellow     =&gt;    "\033[33m",&lt;br /&gt;    	:blue       =&gt;    "\033[34m",&lt;br /&gt;    	:magenta    =&gt;    "\033[35m",&lt;br /&gt;    	:cyan       =&gt;    "\033[36m",&lt;br /&gt;    	:white      =&gt;    "\033[37m",&lt;br /&gt;    	# background colors&lt;br /&gt;    	:on_black   =&gt;    "\033[40m", &lt;br /&gt;    	:on_red     =&gt;    "\033[41m",&lt;br /&gt;    	:on_green   =&gt;    "\033[42m",&lt;br /&gt;    	:on_yellow  =&gt;    "\033[43m",&lt;br /&gt;    	:on_blue    =&gt;    "\033[44m",&lt;br /&gt;    	:on_magenta =&gt;    "\033[45m",&lt;br /&gt;    	:on_cyan    =&gt;    "\033[46m",&lt;br /&gt;    	:on_white   =&gt;    "\033[47m" }&lt;br /&gt;  &lt;br /&gt;  # Methods to use if you want to apply a style&lt;br /&gt;  def UnixConsoleStyle::apply_style(style)&lt;br /&gt;    STDOUT.write STYLE[style]&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 28 Nov 2007 19:21:49 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4822</guid>
      <author>kedare (Mathieu Poussin)</author>
    </item>
    <item>
      <title>compactness considered harmful</title>
      <link>http://snippets.dzone.com/posts/show/3761</link>
      <description>the guys over @ http://101out.com/optimize_html_size.html have a nice post about writing compact code to &#8216;give your site that edge&#8217; (my words) by compacting the hell out of your html and css. Sound as it sounds, it may very well not be what you want, or need.&lt;br /&gt;&lt;br /&gt;for coding means authoring, writing, creating engines that do work. meaningful work, at the least working around meaning. your snippets count. they&#8217;re also a technology that is about posterity, and be that the next day. even if you don't plan your work, you still have some sort of goal when doing it, a future state. &lt;br /&gt;&lt;br /&gt;there's a reason for most programming languages to be readable. however, programming and natural languages alike are but slate for chalk. so while it is perfectly possible to say `vals1=parms[:attrs]`, in most cases code like `attributiveValues=parameters[:attributes]` can assist you and others in reading, understanding, &amp; writing code that makes that more sense. &lt;br /&gt;&lt;br /&gt;in other words, so that others may better undestand me, i try to use language in a way that is less terse and cryptic than some of the usage that bytecount-aficionad&#243;s defer to. you'll be soon outgrown by tomorrow&#8217;s technologies if your hard work goes into maxing out byte efficency by hand. consider how much you can squeeze out of a webpage in turns of size. a few thousand bytes. i'm not talking about oversized `*.jpg`s here, those are still chunky. i talk about your `*.js`es, your `*.html`s and your `*.py`s. look, you squeeezed those bytes out of &lt;code&gt;.top-left-div{border-width:1px}&lt;/code&gt; so now it reads &lt;code&gt;.tld{border-width:1px}&lt;/code&gt;, and with 8-odd bytes still dripping from your fingers, you *forget* about that, it&#8217;s *history* to you. &lt;br /&gt;&lt;br /&gt;meanwhile, some nerd has installed a freifunk wifi repeater in your street, meaning that the increased efficiency of your ambience means a far bigger increase in website availability than what your lexical shortcircuiting achieved. &lt;br /&gt;&lt;br /&gt;back in the future, generations write many commentaries about the possible hidden semantics in css class `.tld`. did those guys really plan to take over a `top-level-domain` and thrive on `http://*.music` as soon as back in 2007? five years before they did? who knows? &lt;br /&gt;&lt;br /&gt;this is not against abbreviations. my own code is full of `*P`s and `**Q`s, what would be `*args` and `**kwargs` much anywhere else. when i find i can establish a useful convention, i do that. so, maybe think it this way: are those `attributes` worth of being called the `A`s here and elsewhere? if you&#8217;re sure, go for it. you just saved 9 times repetitions bytes, that may add up to a lot. if you hate that much typing, get yourself a word completing ide (see, another abbr). but drop those `attrs` and `attribs`. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description>
      <pubDate>Wed, 04 Apr 2007 19:01:53 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3761</guid>
      <author>LoveEncounterFlow (Flow)</author>
    </item>
    <item>
      <title>using Event.observe for when a page loads</title>
      <link>http://snippets.dzone.com/posts/show/3025</link>
      <description>I just prefer this implementation as opposed to window.onload.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Event.observe( window, 'load', function() {&lt;br /&gt;  // Put the Javascript that needs to happen when the page&lt;br /&gt;  // loads here&lt;br /&gt;} );&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;For example, here's a way to make most of your input fields and all of your textareas have a different class when they're selected.  Useful if you want to style them differently with CSS.&lt;br /&gt;&lt;code&gt;Event.observe( window, 'load', function() {&lt;br /&gt;  var inputs = document.getElementsByTagName( 'input' );&lt;br /&gt;  var textareas = document.getElementsByTagName( 'textarea' );&lt;br /&gt;&lt;br /&gt;  for ( var i=0; i&lt;inputs.length; i++ ) {&lt;br /&gt;    type = inputs[i].type;&lt;br /&gt;&lt;br /&gt;    if (&lt;br /&gt;      ( type == 'button' || type == 'reset' ||&lt;br /&gt;      type == 'password' || type == 'text' ||&lt;br /&gt;      type == 'submit' ) &amp;&amp;&lt;br /&gt;      ( inputs[i].onfocus == '' ||&lt;br /&gt;      !inputs[i].onfocus )&lt;br /&gt;    ) {&lt;br /&gt;      inputs[i].onfocus = function() {&lt;br /&gt;        this.className = 'selected';&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      inputs[i].onblur = function() {&lt;br /&gt;        this.className = '';&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  for ( var i=0; i&lt;textareas.length; i++ ) {&lt;br /&gt;    if ( textareas[i].onfocus == '' || !textareas[i].onfocus ) {&lt;br /&gt;      textareas[i].onclick = function() {&lt;br /&gt;        this.className = 'selected';&lt;br /&gt;      }&lt;br /&gt;      textareas[i].onblur = function() {&lt;br /&gt;        this.className = '';&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;} );&lt;/code&gt;</description>
      <pubDate>Mon, 20 Nov 2006 20:47:53 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3025</guid>
      <author>moneypenny ()</author>
    </item>
    <item>
      <title>Toggle an element's display</title>
      <link>http://snippets.dzone.com/posts/show/1721</link>
      <description>Sometimes you have a content that shouldn't display&lt;br /&gt;by default. You can provide a link to display/hide&lt;br /&gt;that content&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;a href='javascript: toggle()'&gt;toggle&lt;/a&gt;&lt;br /&gt;&lt;div id='div1' style='display:none'&gt;&lt;br /&gt;Don't display me&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;script&gt;&lt;br /&gt;function toggle(){&lt;br /&gt;	var div1 = document.getElementById('div1')&lt;br /&gt;	if (div1.style.display == 'none') {&lt;br /&gt;		div1.style.display = 'block'&lt;br /&gt;	} else {&lt;br /&gt;		div1.style.display = 'none'&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 20 Mar 2006 13:17:06 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1721</guid>
      <author>korakot (Korakot Chaovavanich)</author>
    </item>
    <item>
      <title>Old and new-style class</title>
      <link>http://snippets.dzone.com/posts/show/1667</link>
      <description>Old style class&lt;br /&gt;&lt;code&gt;&lt;br /&gt;class K:&lt;br /&gt;  ...&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;New style class&lt;br /&gt;&lt;code&gt;&lt;br /&gt;class K(object):&lt;br /&gt;  ...&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Some features such as properties are only avaiable in new-style class.&lt;br /&gt;Learn more about &lt;a href=http://www.python.org/doc/newstyle.html&gt;New-style class&lt;/a&gt;</description>
      <pubDate>Thu, 09 Mar 2006 12:21:30 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1667</guid>
      <author>korakot (Korakot Chaovavanich)</author>
    </item>
    <item>
      <title>Using &amp;lt;font&gt; (font tag) within pys60 Text widget</title>
      <link>http://snippets.dzone.com/posts/show/1612</link>
      <description>The Text widget allow rich text. However, it's quite&lt;br /&gt;difficult to use. You need to set each attribute&lt;br /&gt;(font, style, highlight, color) of the widget&lt;br /&gt;before adding more text with differert style.&lt;br /&gt;&lt;br /&gt;So, I make a function that make it a bit easier.&lt;br /&gt;The font tag (&lt;font&gt;&lt;/font&gt;) is used (borrowed from HTML).&lt;br /&gt;Attributes allowed are&lt;br /&gt;- color ( #RRGGBB or 0xRRGGBB or color name)&lt;br /&gt;- face ( both font and size eg. albi17b )&lt;br /&gt;- style ( bold, italic, underline or strikethrough )&lt;br /&gt; (styles can be combined using comma)&lt;br /&gt;- highlight ( standard, rounded, shadow)&lt;br /&gt;- hcolor ( highlight color )&lt;br /&gt;&lt;code&gt;&lt;br /&gt;from appuifw import *&lt;br /&gt;&lt;br /&gt;def process_color(color):&lt;br /&gt;    color_name = {&lt;br /&gt;        'red': 0xff0000, 'green': 0x008000, 'blue':0x0000ff,       &lt;br /&gt;        'black': 0,      'white':0xffffff,      'yellow': 0xffff00&lt;br /&gt;        }&lt;br /&gt;    if color.startswith('#'):   # HTML format #000000&lt;br /&gt;        return int(color[1:], 16)&lt;br /&gt;    if color.startswith('0x'):  # pys60 format 0x000000&lt;br /&gt;        return int(color, 16)&lt;br /&gt;    return color_name[color]&lt;br /&gt;&lt;br /&gt;def set_ml(t, s):&lt;br /&gt;    stack = []&lt;br /&gt;    t.clear()&lt;br /&gt;    t.font = 'normal'&lt;br /&gt;    i = 0&lt;br /&gt;    while i &lt; len(s):&lt;br /&gt;        if s.startswith('&lt;', i):  # tag end or tag begin&lt;br /&gt;            j = s.find('&gt;', i) + 1&lt;br /&gt;            if s[i:i+7] == '&lt;/font&gt;' or s[i:i+3] == '&lt;/&gt;':&lt;br /&gt;                t.color, t.font, t.style, t.highlight_color = stack.pop()&lt;br /&gt;            else:&lt;br /&gt;                stack.append([t.color, t.font, t.style, t.highlight_color])&lt;br /&gt;                to_style = 0&lt;br /&gt;                for attr_val in s[i:j-1].split(' '):&lt;br /&gt;                    if '=' in attr_val:&lt;br /&gt;                        attr, val = attr_val.split('=')&lt;br /&gt;                        if attr == 'color':&lt;br /&gt;                            t.color = process_color(val)&lt;br /&gt;                        elif attr == 'face':&lt;br /&gt;                            t.font = unicode(val)&lt;br /&gt;                        elif attr == 'hcolor':&lt;br /&gt;                            t.highlight_color = process_color(val)&lt;br /&gt;                        elif attr == 'style':   # style and highlight go together&lt;br /&gt;                            to_style |= eval('|'.join(['STYLE_' + st.upper() for st in val.split(',')]))&lt;br /&gt;                        elif attr == 'highlight':&lt;br /&gt;                            to_style |= eval("HIGHLIGHT_" + val.upper())&lt;br /&gt;                if to_style:&lt;br /&gt;                    t.style = to_style&lt;br /&gt;        else:    # normal text&lt;br /&gt;            j = s.find('&lt;', i)&lt;br /&gt;            if j == -1: j = len(s)&lt;br /&gt;            text = u'' + s[i:j].replace('&amp;lt;', '&lt;')&lt;br /&gt;            t.add(text)&lt;br /&gt;        i = j      # go next chunk&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Now you can use it easily&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&gt;&gt;&gt; t = app.body   # use the default Text widget that start pys60&lt;br /&gt;&gt;&gt;&gt; set_ml(t, '&lt;font color=red&gt;Hello&lt;/font&gt; &lt;font style=bold&gt;World&lt;/font&gt;.')&lt;br /&gt;&gt;&gt;&gt;  # a stylish 'Hello World' is displayed&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Notice:&lt;br /&gt;- Quotation marks are not used to specify attribute values.&lt;br /&gt;- A &lt;/&gt; shorthand can be used for &lt;/font&gt;&lt;br /&gt;- &lt;font&gt; can be nested.</description>
      <pubDate>Thu, 02 Mar 2006 11:19:20 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1612</guid>
      <author>korakot (Korakot Chaovavanich)</author>
    </item>
    <item>
      <title>Vertical Centering in CSS</title>
      <link>http://snippets.dzone.com/posts/show/455</link>
      <description>&lt;code&gt;&lt;br /&gt;#center{&lt;br /&gt;   width:100px;&lt;br /&gt;   height:100px;&lt;br /&gt;   position:absolute;&lt;br /&gt;   top:50%;&lt;br /&gt;   left:50%;&lt;br /&gt;   margin-top:-50px;&lt;br /&gt;   margin-left:-50px;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;usage:&lt;br /&gt;&lt;br /&gt;&lt;img id="center" src="path/image.gif":</description>
      <pubDate>Mon, 04 Jul 2005 10:39:30 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/455</guid>
      <author>rafaeltds (Rafael Trindade da Silva)</author>
    </item>
    <item>
      <title>Zebra stripes on table rows using Rails / RHTML</title>
      <link>http://snippets.dzone.com/posts/show/408</link>
      <description>&lt;code&gt;&lt;% @projects.each_with_index do |project, i| %&gt;&lt;br /&gt;&lt;% row_class = i%2 == 0 ? "even" : "odd" %&gt; &lt;br /&gt;&lt;tr class="&lt;%= row_class %&gt;"&gt;&lt;br /&gt;......&lt;br /&gt;&lt;% end %&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;In the CSS:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;TR.even { background-color: #f00; }&lt;br /&gt;TR.odd { background-color: #f00; }&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;etc..</description>
      <pubDate>Wed, 22 Jun 2005 09:57:04 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/408</guid>
      <author>peter (Peter Cooperx)</author>
    </item>
  </channel>
</rss>
