<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 전환//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br><html xmlns="http://www.w3.org/1999/xhtml"> <br><머리> <br><제목></제목> <br><style type="text/css"> <br>이미지 <br>{ <br>너비:100px; <br>높이:100px; <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('너비', '600px'); <br>tablenode.setAttribute('높이', '400px'); <br>tablenode.setAttribute('border', '2px'); <br>var 개수 = 0; <br>for (var i = 0; i < 3; i ) { <BR>var trnode = document.createElement('tr'); <BR>for (var j = 0; j < 5; j ) { <BR>var tdnode = document.createElement('td'); <BR>var imgnode = document.createElement('img'); <BR>imgnode.setAttribute('src', 'scenery/' array[count]); <BR>// imgnode.setAttribute('너비', '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(테이블노드); <BR>} <BR></script> <br></head> <br><본문> <br><input type="button" value="创建상册" onclick="createimgs();" /> <br></body> <br></html> <br> </div>