Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- table = document.createElement('table');
- table.style.border = '1px solid black';
- table.style.borderRadius = '5px';
- table.style.margin = '0 auto';
- for (i = 0; i < info.length; i++) {
- row = document.createElement('tr');
- row.className = 'dbl';
- row.id = i;
- for (j = 0; j < info[i].length; j++) {
- cell = document.createElement('td');
- cell.appendChild(document.createTextNode(info[i][j]));
- cell.style.borderBottom = '1px solid #ddd';
- cell.style.padding = '4px';
- cell.style.width = '130px';
- row.appendChild(cell);
- }
- table.appendChild(row);
- }
- document.body.appendChild(table);
- for (i=1;i < info.length; i++) {
- document.getElementById("" + i).addEventListener("dblclick", zxc);
- function zxc() {
- var modal = document.getElementById('myModal');
- var span = document.getElementsByClassName("close")[0];
- modal.style.display = "block";
- span.onclick = function () {
- modal.style.display = "none";
- }
- window.onclick = function (event) {
- if (event.target == modal) {
- modal.style.display = "none";
- }
- }
- document.getElementById('client').value = info[i][0];
- document.getElementById('date').value = info[i][1];
- document.getElementById('sum').value = info[i][2];
- document.getElementById('val').value = info[i][3];
- }
Add Comment
Please, Sign In to add comment