<div class="codetitle"> <span><a style="CURSOR: pointer" data="14072" class="copybut" id="copybut14072" onclick="doCopy('code14072')"><u>复制代</u></a></span> 代码如下:</div> <div class="codebody" id="code14072"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <BR><html xmlns="http://www.w3.org/1999/xhtml"> <br> <br><title></title> <br><style type="text/css"> <br>画像 <br>{ <br>幅:100px; <br>高さ:100ピクセル; <br>} <br></style> <br><script type="text/javascript"> <br>function createimgs() { <br>var array = ['29b56ef1ecac0a2e23fe73abb8457ed9.jpg', <br>'3615bd55e6db2d3eb2a45a8369653f12(1).jpg', <br>'3615bd55e6db2d3eb2a4 5a8369653f12.jpg'、<br>'837adad119910d349f05149ad4a02ef0.jpg' , <br>'849b23dac9ceafe6d7e7b94a73b46e82.jpg', <br>'91fe451f6e8081fe492c6ae617a50274.jpg', <br>'9b1b7be8d60eef1e15257797d779d91b.jpg', <br>'9fce9273034aed88fab0bcfef344dae7.jpg'、<br>'a5f59f9d670a936bf8281090bc2ce7c7.jpg'、<br>' cda8a8f5b72e165c153fd396db02ab64.jpg', <br>'d159717ab855f729066b333d439f630e.jpg', <br>'d7ef1897c62640dba44532e6475c49c6.jpg', <br>' ef62b67b4dc1bc80daaaf9ebbf90d854.jpg', <br>'f6b31d9bca975794bd23fdf71295e1c4.jpg', <br>'f856bd37b432eb532098fa170dfbafd4.jpg' <br>]; <br>//alert(array.length); <br>var tablenode = document.createElement('table'); <br>var tbody = document.createElement('tbody'); <br>tablenode.setAttribute('width', '600px'); <br>tablenode.setAttribute('height', '400px'); <br>tablenode.setAttribute('border', '2px'); <br>変数カウント = 0; <br>for (var i = 0; i var trnode = document.createElement('tr'); <br>for (var j = 0; j var tdnode = document.createElement('td'); <br>var imgnode = document.createElement('img'); <br>imgnode.setAttribute('src', 'scenery/' array[count]); <br>// imgnode.setAttribute('width', '100px'); <br>// imgnode.setAttribute('height', '100px'); <br>tdnode.appendChild(imgnode); <br>trnode.appendChild(tdnode); <br>カウント; <br>} <br>tbody.appendChild(trnode); <br>} <br>tablenode.appendChild(tbody); <br>document.body.appendChild(tablenode); <br>} <br></script> <br></head> <br> <br><input type="button" value="创建相册" onclick="createimgs();" /> <BR></body> <br></html> <br> </div>