<?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>Coyote Lab &#187; jQuery</title>
	<atom:link href="http://coyotelab.org/blog/category/jquery/feed" rel="self" type="application/rss+xml" />
	<link>http://coyotelab.org/blog</link>
	<description></description>
	<lastBuildDate>Thu, 19 Aug 2010 06:21:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Create a cool looking jQuery data table</title>
		<link>http://coyotelab.org/blog/jquery/create-a-cool-looking-jquery-data-table</link>
		<comments>http://coyotelab.org/blog/jquery/create-a-cool-looking-jquery-data-table#comments</comments>
		<pubDate>Wed, 25 Nov 2009 09:01:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://coyotelab.org/blog/?p=169</guid>
		<description><![CDATA[In this article I&#8217;ll explain how to create a cool looking data table using jQuery&#8230;

Step 1 – HTML Page
File Name: xpand.html
&#60;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&#62;
&#60;html xmlns="http://www.w3.org/1999/xhtml"&#62;
&#60;head&#62;
&#60;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&#62;
&#60;title&#62;jQuery Data Table&#60;/title&#62;
&#60;link rel="stylesheet" href="style.css" type="text/css" media="screen"/&#62;
&#60;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&#62;&#60;/script&#62;
&#60;script type="text/javascript" src="roll_over.js"&#62;&#60;/script&#62;
&#60;script type="text/javascript" src="slide.js"&#62;&#60;/script&#62;
&#60;/head&#62;
&#60;body&#62;
&#60;div class="container"&#62;
  &#60;div class="country"&#62;
    &#60;table   [...]]]></description>
			<content:encoded><![CDATA[<p>In this article I&#8217;ll explain how to create a cool looking data table using jQuery&#8230;</p>
<p><span id="more-169"></span></p>
<h3>Step 1 – HTML Page</h3>
<p><strong>File Name:</strong> xpand.html</p>
<pre><code >&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;jQuery Data Table&lt;/title&gt;
&lt;link rel="stylesheet" href="style.css" type="text/css" media="screen"/&gt;
&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="roll_over.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="slide.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class="container"&gt;
  &lt;div class="country"&gt;
    &lt;table   border="0" cellpading="0" cellspacing="0"&gt;
      &lt;tr&gt;
        &lt;td width="275" height="30"&gt;&lt;h3&gt;Austria&lt;/h3&gt;&lt;/td&gt;
        &lt;td style="border-left: 1px solid #C7004A;" width="160" height="30"&gt;&lt;div align="center"&gt;&lt;img src="Empty_btn.png" width="125" height="21"/&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;td style="border-left: 1px solid #C7004A;" width="160" height="30"&gt;&lt;div align="center"&gt;&lt;h4&gt;&lt;img src="View_btn.png" class="ro" /&gt;&lt;/h4&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;td style="border-left: 1px solid #C7004A;" width="160" height="30"&gt;&lt;div align="center"&gt;&lt;img src="Empty_btn.png" width="125" height="21"/&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/div&gt;&lt;!-- country ends --&gt;
  &lt;div class="mv"&gt;
    &lt;table  width="760" border="0" cellpading="0" cellspacing="0" &gt;
      &lt;tr&gt;
        &lt;td width="275" height="140" valign="top"&gt;&lt;h3&gt;Austria&lt;/h3&gt;&lt;img src="Country_Bt_border.gif"/&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;&lt;img src="Empty_Sales_Aid.gif" width="73" height="105" alt="" /&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;&lt;img src="FPO_Sales_Aid.gif" width="73" height="105" alt="" /&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;&lt;img src="Empty_Sales_Aid.gif" width="73" height="105" alt="" /&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td width="275" height="40" valign="bottom"&gt;&lt;p&gt;[x]close&lt;/p&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;text&lt;/div&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;text&lt;/div&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;text&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/div&gt;&lt;!-- mv ends --&gt;
  &lt;div class="country"&gt;
    &lt;table  border="0" cellpading="0" cellspacing="0"&gt;
      &lt;tr&gt;
        &lt;td width="275" height="30"&gt;&lt;h3&gt;Belgium&lt;/h3&gt;&lt;/td&gt;
        &lt;td style="border-left: 1px solid #C7004A;" width="160" height="30"&gt;&lt;div align="center"&gt;&lt;h4&gt;&lt;img src="View_btn.png" class="ro" /&gt;&lt;/h4&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;td style="border-left: 1px solid #C7004A;" width="160" height="30"&gt;&lt;div align="center"&gt;&lt;h4&gt;&lt;img src="View_btn.png" class="ro" /&gt;&lt;/h4&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;td style="border-left: 1px solid #C7004A;" width="160" height="30"&gt;&lt;div align="center"&gt;&lt;img src="Empty_btn.png" width="125" height="21"/&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/div&gt;&lt;!-- country ends --&gt;
  &lt;div class="mv"&gt;
    &lt;table width="760" border="0" cellpading="0" cellspacing="0" &gt;
      &lt;tr&gt;
        &lt;td width="275" height="140" valign="top"&gt;&lt;h3&gt;Belgium&lt;/h3&gt;&lt;img src="Country_Bt_border.gif"/&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;&lt;img src="FPO_Sales_Aid.gif" width="73" height="105" alt="" /&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;&lt;img src="FPO_Sales_Aid.gif" width="73" height="105" alt="" /&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;&lt;img src="Empty_Sales_Aid.gif" width="73" height="105" alt="" /&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td width="275" height="40" valign="bottom"&gt;&lt;p&gt;[x]close&lt;/p&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;text&lt;/div&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;text&lt;/div&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;text&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/div&gt;&lt;!-- mv ends --&gt;
  &lt;div class="country"&gt;
    &lt;table border="0" cellpading="0" cellspacing="0"&gt;
      &lt;tr&gt;
        &lt;td width="275" height="30"&gt;&lt;h3&gt;Bulgaria&lt;/h3&gt;&lt;/td&gt;
        &lt;td style="border-left: 1px solid #C7004A;" width="160" height="30"&gt;&lt;div align="center"&gt;&lt;img src="Empty_btn.png" width="125" height="21"/&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;td style="border-left: 1px solid #C7004A;" width="160" height="30"&gt;&lt;div align="center"&gt;&lt;img src="Empty_btn.png" width="125" height="21"/&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;td style="border-left: 1px solid #C7004A;" width="160" height="30"&gt;&lt;div align="center"&gt;&lt;h4&gt;&lt;img src="View_btn.png" class="ro" /&gt;&lt;/h4&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/div&gt;&lt;!-- country ends --&gt;
  &lt;div class="mv"&gt;
    &lt;table width="760" border="0" cellpading="0" cellspacing="0" &gt;
      &lt;tr&gt;
        &lt;td width="275" height="140" valign="top"&gt;&lt;h3&gt;Bulgaria&lt;/h3&gt;&lt;img src="Country_Bt_border.gif"/&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;&lt;img src="Empty_Sales_Aid.gif" width="73" height="105" alt="" /&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;&lt;img src="Empty_Sales_Aid.gif" width="73" height="105" alt="" /&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;&lt;img src="FPO_Sales_Aid.gif" width="73" height="105" alt="" /&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td width="275" height="40" valign="bottom"&gt;&lt;p&gt;[x]close&lt;/p&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;text&lt;/div&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;text&lt;/div&gt;&lt;/td&gt;
        &lt;td width="160"&gt;&lt;div align="center"&gt;text&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/div&gt;&lt;!-- mv ends --&gt;
&lt;/div&gt;&lt;!-- container ends --&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
<h3>Step 2 – Add Style</h3>
<p><strong>File Name:</strong> style.css</p>
<pre><code>*          {margin: 0; padding: 0;}
body       {font-family: helvetica; font-size: 14px; font-weight: bold; color: #333;}
p          {font-size: 16px; color: #e792b1; padding: 0 0 10px 10px; cursor:pointer;}
.container {width: 760px; margin: 0 auto; padding: 50px 0 0 0;}
.country   {border-top: 1px solid #C7004A; width: 100%;}
.mv        {margin: 0; padding: 0; border-top: 1px solid #C7004A;}
img        {border: 0 none;}
h3         {padding: 5px 10px; font-size: 14px; color: #454545;}
h4	 {cursor:pointer;}</code></pre>
<h3>Step 3 – jQuery slider effect</h3>
<p><strong>File Name:</strong> slide.js</p>
<pre><code>$(document).ready(function(){
	$('div.mv').hide().css('background-color', '#F7D9E4');
  	$('h4').click(function(){
  		$(this).parents("div.country").next().slideDown("slow")
  		.prev().hide(".country").next().siblings('div.mv')
  		.slideUp("slow").prev().show("div.country");
  		return false;
  	});
  	$('p').click(function(){
  		$(this).parents("div.mv").slideUp("slow")
  		.prev().css('background-color', '#FFFFFF').show(".country");
  		return false;
  	});
  	$( function(){
  		$('.country').hover( function(){
  			$(this).css('background-color', '#F7D9E4');
  		},
  		function(){
  			$(this).css('background-color', '#FFF');
  		});
	});
});</code></pre>
<h3>Step 3 – jQuery hover effect</h3>
<p><strong>File Name:</strong> roll-over.js</p>
<pre><code>$(document).ready( function(){
	PEPS.rollover.init();
});
	PEPS = {};
	PEPS.rollover =
	{
		init: function(){
			this.preload();
			$(".ro").hover(
				function () { $(this).attr( 'src', PEPS.rollover.newimage($(this).attr('src')) ); },
				function () { $(this).attr( 'src', PEPS.rollover.oldimage($(this).attr('src')) ); }
			);
		},
		preload: function(){
			$(window).bind('load', function() {
				$('.ro').each( function( key, elm ) { $('&lt;img alt="" /&gt;').attr( 'src', PEPS.rollover.newimage( $(this).attr('src') ) ); });
			});
		},
		newimage: function( src ) { return src.substring( 0, src.search(/(\.[a-z]+)/) ) + '_o' + src.match(/(\.[a-z]+)/)[0]; },
		oldimage: function( src ){ return src.replace(/_o/, ''); }
	};</code></pre>
<p class="pre">Click here to view <a href="http://coyotelab.org/prototype_final/xpand.html">Live Demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://coyotelab.org/blog/jquery/create-a-cool-looking-jquery-data-table/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
