/* 
    Document   : responsivedatatable
    Created on : 28/02/2012, 11:01:54 AM
    Author     : Simon Elvery
    Description:
        Demonstration of the responsive tables method described at by Chris Coyier
		at http://css-tricks.com/responsive-data-tables/
        
        Usage: put table (table should be proper with thead and tbody and also put table heading in td using data-title attribute) in section or div with id="responsivedatatable" like example below:
        <section id="responsivedatatable">
        	<table>
		<thead>
    		<tr>
    			<th>First Name</th>
    			<th>Last Name</th>
    			<th>Job Title</th>
    		</tr>
		</thead>
		<tbody>
    		<tr>
    			<td data-title="First Name">James</td>
    			<td data-title="Last Name">Matman</td>
    			<td data-title="Job Title">Chief Sandwich Eater</td>
    		</tr>
		</tbody>
	</table>

        </section>
*/

@media only screen and (max-width: 800px) {
	
	/* Force table to not be like tables anymore */
	#responsivedatatable table, 
	#responsivedatatable thead, 
	#responsivedatatable tbody, 
	#responsivedatatable th, 
	#responsivedatatable td, 
	#responsivedatatable tr { 
		display: block; 
	}

	/* Hide table headers (but not display: none;, for accessibility) */
	#responsivedatatable thead tr { 
		position: absolute;
		top: -9999px;
		left: -9999px;
	}

	#responsivedatatable tr { border: 1px solid #ccc; }

	#responsivedatatable td { 
		/* Behave  like a "row" */
		border: none;
		border-bottom: 1px solid #eee; 
		position: relative;
		padding-left: 50%; 
		white-space: normal;
		text-align:left;
	}

	#responsivedatatable td:before { 
		/* Now like a table header */
		position: absolute;
		/* Top/left values mimic padding */
		top: 6px;
		left: 6px;
		width: 45%; 
		padding-right: 10px; 
		white-space: nowrap;
		text-align:left;
		font-weight: bold;
	}

	/*
	Label the data
	*/
	#responsivedatatable td:before { content: attr(data-title); }
}
	