var arr=[[1,2,3,10],[4,5,6,11],[7,8,9,12]];
var arr1=[];
for (var i=0;i<arr[0].length;i++)
{
arr1[i]=[];
}
for (var i=0;i<arr.length;i++)
{
for (var j=0;j<arr[i].length;j++ )
{
arr1[j][i]=arr[i][j];
}
}
for (var i=0;i<arr1.length;i++ )
{
for (var j=0;j<arr1[i].length;j++ )
{
document.writeln(arr1[i][j]+' ');
}
document.writeln("<br/>");
}