セル幅取得 セル幅設定 参考 s2-16s | ||||||||||||||||||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <meta name="GENERATOR" content="JustSystems Homepage Builder Version 18.0.7.0 for Windows"> <title></title> </head> <body> table1 table1a table2 table2a |
<script> function s1(){ // 起動時実行はこの行を削除 var tbl1=document.getElementById("table1"); var tbl1a=document.getElementById("table1a"); var w0 = null; var w1 = null; w0 = getComputedStyle(tbl1.rows[0].cells[0]); w1 = getComputedStyle(tbl1.rows[0].cells[1]); tbl1a.rows[0].cells[0].width = w0.width; // 上は下記の style に相当の w*.width があると不可? tbl1a.rows[0].cells[1].width = w1.width; var tbl2=document.getElementById("table2"); var tbl2a=document.getElementById("table2a"); var style = null; for(var i=0;tbl2.rows[0].cells[i];i++){ style = getComputedStyle(tbl2.rows[0].cells[i], ''); tbl2a.rows[0].cells[i].style.width = style.width; // styleがなくても可? } } // 起動時実行はこの行を削除 function s2(){ // 起動時実行は以下3行を削除 location.href = "s2-16s.html" } </script> </body> </html> セル幅取得 : getComputedStyle s2-17s 参照 |