﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ladysign Dev Blog &#187; itunes style</title>
	<atom:link href="http://www.ladysign-apps.com/blog/tag/itunes-style/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ladysign-apps.com/blog</link>
	<description>Girls can code.</description>
	<lastBuildDate>Mon, 01 Feb 2010 09:44:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Create iTunes styled tables with jQuery and CSS</title>
		<link>http://www.ladysign-apps.com/blog/code/css/create-itunes-styled-tables-with-jquery-and-css/</link>
		<comments>http://www.ladysign-apps.com/blog/code/css/create-itunes-styled-tables-with-jquery-and-css/#comments</comments>
		<pubDate>Mon, 11 May 2009 11:10:45 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[css 3]]></category>
		<category><![CDATA[even]]></category>
		<category><![CDATA[ipod style]]></category>
		<category><![CDATA[itunes style]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[odd]]></category>
		<category><![CDATA[pseudo class]]></category>
		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/blog/?p=673</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 2 out of 5 stars</p>
<p>Do you like those iTunes styled tabels? These tabels give you a nice overview since every odd and even row contains a dif[......]</p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 2 out of 5 stars</p>
<p>Do you like those iTunes styled tabels? These tabels give you a nice overview since every odd and even row contains a different color.</p>
<p>But when your tabel contains dynamic data, you don&#8217;t know how many and which rows you have to style with an odd or even color class.</p>
<p>Styling odd and even rows, can be done by using CSS 3, write <a href="http://www.w3.org/TR/css3-selectors/">pseudo class notations</a>. </p>
<pre class="brush: css;">table tbody tr:nth-child(even) { background: #f1f5fa; }
table tbody tr:nth-child(odd) { background: #fff; } </pre>
<p>Ofcourse and unfortunately not all browsers (*IE(eek)*) support CSS 3.</p>
<p>Read below, how to do this with jQuery. You can write this in less then 5 lines.<br />
You will only need to download JQuery Javascript framework and including it in your webproject.</p>
<p><a href="http://ladysign-apps.com/blog/lee/example-table.jpg"><img src="http://ladysign-apps.com/blog/lee/example-table-300x44.jpg" alt="Example iTunes tabel"/></a></p>
<p>Here are the files you will need:</p>
<p>The HTML to create a accessible tabel:</p>
<pre class="brush: xml;">&lt;table&gt;
 &lt;thead&gt;
  &lt;tr&gt;
   &lt;th&gt;Head 1&lt;/th&gt;
   &lt;th&gt;Head 2&lt;/th&gt;
   &lt;th&gt;Head 3&lt;/th&gt;
  &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
  &lt;tr&gt;
   &lt;td&gt;Cell 1&lt;/td&gt;
   &lt;td&gt;Cell 2&lt;/td&gt;
   &lt;td&gt;Cell 3&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Cell 4&lt;/td&gt;
   &lt;td&gt;Cell 5&lt;/td&gt;
   &lt;td&gt;Cell 6&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Cell 7&lt;/td&gt;
   &lt;td&gt;Cell 8&lt;/td&gt;
   &lt;td&gt;Cell 9&lt;/td&gt;
  &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;</pre>
<p>The styles for a iTunes generic tabel style:</p>
<pre class="brush: css;">table { background-color: #fff; border: 1px solid #ddd; empty-cells: show; font-size: 90%; margin: 10px 0 20px 20px; padding: 4px; text-align: left; width: 650px; }
table caption { color: #777; margin: 0 0 5px 0; padding: 0; text-align: center; text-transform: uppercase; }
table thead th { border: 0; border-bottom: 1px solid #ddd; color: #000; font-size: 90%; padding: 3px; margin: 0 0 5px 0; text-align: left; }
table tbody tr { background-color: #fff; }
table tbody tr:hover { background-color: #3D80DF !important; color: #fff; }
table tbody td { color: #000; padding: 2px; border: 0; }
table tbody tr:hover td { color: #fff; } </pre>
<p>jQuery, where you will pick all the odd table rows and give it the blue iTunes color:</p>
<pre class="brush: jscript;">//JQuery functions
$(document).ready(function(){
	//odd even table cells.
	$(&quot;tr:odd&quot;).css(&quot;background-color&quot;, &quot;#F1F5FA&quot;);
});</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/css/create-itunes-styled-tables-with-jquery-and-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
