 (function($) {
   $.fn.pandaTable = function(settings) {
     var config = {'foo': 'bar'};
     if (settings) $.extend(config, settings);
     this.each(function() {
    	 //alert('panda');
       // element-specific code here
  		$('tr:even',this).addClass('even-row');
		$('tr:odd',this).addClass('odd-row');

		$('tr>td:first-child,tr>th:first-child',this).addClass('td-left');
		$('tr>td:last-child,tr>th:last-child',this).addClass('td-right');
		
		$('tbody>tr:last-child td:first-child',this).addClass('left');
		$('tbody>tr:last-child td:last-child',this).addClass('right');
		
		if ($('.media-table').length == 1) {
			var rowCells = $('tbody>tr:first-child td',this).length;
			var numCells = $('tbody>tr:last-child td',this).length;
			var addCells = (rowCells + 1) - numCells;
			var className = "td-padding-" + (addCells-1);
			$('tbody>tr:last-child td:last-child',this).attr('colspan',addCells);
			$('tbody>tr:last-child td:last-child',this).addClass(className);
		}
     });
     return this;
   };
 })(jQuery);
 
 
// $(document).ready(function(){
//	 $('#formated-table').pandaTable();
// });
