function format_table2(target,max_width){
	$(target+' table').each(
		function(){
			if( $(this).width()>max_width ){
				ratio = $(this).width() / max_width;
				$(this).width(max_width) ;
				$(this).removeClass();
				$(this).removeAttr('style');
				$(this).attr('border',1);
				$(this).removeAttr('cell-spacing');
				$(this).removeAttr('cell-padding');
				$(this).attr('bordercolor','#000000');

				$(this).find('td').each(
					function(){
						$(this).width( $(this).width()/ratio );
						$(this).removeClass();
						$(this).removeAttr('style');
						$(this).removeAttr('nowarp');
						$(this).html($(this).text());
					}
				)
			}
		}
	);
}

function format_table(target,max_width){
	$(target+' table').each(
		function(){
			if( $(this).width()>max_width ){
				ratio = $(this).width() / max_width;
				$(this).width(max_width) ;
				$(this).find('td').each(
					function(){
						$(this).width( $(this).width()/ratio );
					}
				)
			}
		}
	);
}
