var v = new Array('00','33','66','99','cc','ff');

var w = (screen.availWidth)/(Math.round(4  *Math.random()) + 1.5);
var h = (screen.availHeight)/(Math.round(4  *Math.random()) + 1.5);
var cellSp = (Math.round(7  *Math.random())) + 1;

function afficher() {
	var r = (Math.round(10  *Math.random()) + 1);
	var c = (Math.round(10  *Math.random()) + 1);
	var imW = (w-(cellSp*c))/(c+1);
	var imH = (h-(cellSp*r))/(r+1);
	var letxt = '<table border="0" cellspacing="' + cellSp + '" cellpadding="0" summary=" ">';	
	for(var i=0; i<r; i++) {
		letxt += '<tr>';
		for(var j=0; j<c; j++) {
			letxt += '<td bgcolor="#';
			var colorCode = v[Math.round(5  *Math.random())] + v[Math.round(5  *Math.random())] + v[Math.round(5  *Math.random())];
			letxt += colorCode + '" width="' + imW + '" height="' + imH + '"><br /><\/td>';
		}
		letxt += '<\/tr>';
	}
	letxt += '<\/table>';
	document.getElementById("matable").innerHTML=letxt;
}

