表の作成コードを変更.
function make_lst () {
let ia = document.getElementById("in__a") ;
let ib = document.getElementById("in__b") ;
let ic = document.getElementById("in__c") ;
let ol = document.getElementById("out_l") ;
let va = ia.value ;
let vb = ib.value ;
let vc = ic.value ;
let lc = Math.log10(vc) ;
lc = Math.ceil(lc) ;
let mc = Math.pow(10,lc) ;
mc/= 10 ;
let s_tb = "<table border='1'>" ;
let e_tb = "</table>" ;
let s_tr = "<tr>" ;
let e_tr = "</tr>" ;
let s_dt = "<td>" ;
let e_dt = "</td>" ;
let tb_d = "" ;
let index = 0 ;
tb_d += s_tb ;
for (index=0 ; index<10 ; index++) {
let c_1 = mc * (index+1) ;
let x_1 = c_1 * vb / va ;
tb_d += s_tr ;
tb_d += s_dt + c_1 + e_dt ;
tb_d += s_dt + x_1 + e_dt ;
tb_d += e_tr ;
}
tb_d += e_tb ;
ol.innerHTML = tb_d ;
}
5. table データ作成のコードを変更
- 詳細
- カテゴリー: 比率計算
- 参照数: 426