table の中身を C の値をもとに作成.
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 t_dt = "" ;
t_dt += s_tb ;
let index = 0 ;
let dt_1 = 0 ;
let dt_2 = 0 ;
for (index=0 ; index<10 ; index++) {
let c_1 = mc * (index+1) ;
let x_1 = c_1 * vb / va ;
dt_1 = c_1 ;
dt_2 = x_1 ;
t_dt = t_dt + s_tr ;
t_dt = t_dt + s_dt ;
t_dt = t_dt + dt_1 ;
t_dt = t_dt + e_dt ;
t_dt = t_dt + s_dt ;
t_dt = t_dt + dt_2 ;
t_dt = t_dt + e_dt ;
t_dt = t_dt + e_tr ;
}
t_dt = t_dt + e_tb ;
ol.innerHTML = t_dt ;
}
4. table データの作成
- 詳細
- カテゴリー: 比率計算
- 参照数: 436