function tableToJson() {
let result = [];
let table = document.getElementById("print-table").getElementsByTagName("tbody")[0];
let trs = table.getElementsByTagName("tr");
for (let i = 2; i < trs.length; i++) {
let tds = trs[i].getElementsByTagName("td");
let obj = {};
obj.name = tds[0].innerHTML;
obj.rank = tds[1].innerHTML;
obj.phone = tds[2].innerHTML;
result.push(obj);
}
return JSON.stringify(result);
}