Copy codeThe Code is as follows: <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Title> </title>
<Style type = "text/css">
Image
{
Width: 100px;
Height: 100px;
}
</Style>
<Script type = "text/javascript">
Function createimgs (){
Var array = require '29b56ef1ecac0a2e23fe73abb8457ed9.jpg ',
'3615bd55e6db2d3eb2a45a8316653f12(1).jpg ',
'3615bd55e6db2d3eb2a45a8316653f12.jpg ',
'837ad119910d349f05149ad4a02ef0.jpg ',
'849b23dac9ceafe6d7e7b94a73b46e82.jpg ',
'91fe451f6e8081fe492c6ae617a50274.jpg ',
'9b1b7be8d60eef1e15257797d779d91b.jpg ',
'9fce9273034aed88fab0bcfef344dae7.jpg ',
'A5f59f9d670a936bf8281090bc2ce7c7.jpg ',
'Cda8a8f5b72e165c153fd417db02ab64.jpg ',
'D159717ab855f729066b333d439f630e.jpg ',
'D7ef1897c62640dba44532e6475c49c6.jpg ',
'Ef62b67b4dc1bc80daaaf9ebbf90d854.jpg ',
'F6b31d9bca975794bd23fdf71295e1c4.jpg ',
'F856bd37b432eb532098fa170dfbafd4.jpg'
];
// Alert (array. length );
Var tablenode = document. createElement ('table ');
Var tbody = document. createElement ('tbody ');
Tablenode. setAttribute ('width', '600px ');
Tablenode. setAttribute ('height', '400px ');
Tablenode. setAttribute ('border', '2px ');
Var count = 0;
For (var I = 0; I <3; I ++ ){
Var trnode = document. createElement ('tr ');
For (var j = 0; j <5; j ++ ){
Var tdnode = document. createElement ('td ');
Var imgnode = document. createElement ('img ');
Imgnode. setAttribute ('src', 'scenery/'+ array [count]);
// Imgnode. setAttribute ('width', '100px ');
// Imgnode. setAttribute ('height', '100px ');
Tdnode. appendChild (imgnode );
Trnode. appendChild (tdnode );
Count ++;
}
Tbody. appendChild (trnode );
}
Tablenode. appendChild (tbody );
Document. body. appendChild (tablenode );
}
</Script>
</Head>
<Body>
<Input type = "button" value = "create album" onclick = "createimgs ();"/>
</Body>
</Html>