Guest User

Untitled

a guest
Nov 19th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. table = document.createElement('table');
  2. table.style.border = '1px solid black';
  3. table.style.borderRadius = '5px';
  4. table.style.margin = '0 auto';
  5. for (i = 0; i < info.length; i++) {
  6. row = document.createElement('tr');
  7. row.className = 'dbl';
  8. row.id = i;
  9. for (j = 0; j < info[i].length; j++) {
  10. cell = document.createElement('td');
  11. cell.appendChild(document.createTextNode(info[i][j]));
  12. cell.style.borderBottom = '1px solid #ddd';
  13. cell.style.padding = '4px';
  14. cell.style.width = '130px';
  15. row.appendChild(cell);
  16. }
  17. table.appendChild(row);
  18. }
  19. document.body.appendChild(table);
  20.  
  21. for (i=1;i < info.length; i++) {
  22. document.getElementById("" + i).addEventListener("dblclick", zxc);
  23.  
  24. function zxc() {
  25. var modal = document.getElementById('myModal');
  26. var span = document.getElementsByClassName("close")[0];
  27. modal.style.display = "block";
  28. span.onclick = function () {
  29. modal.style.display = "none";
  30. }
  31. window.onclick = function (event) {
  32. if (event.target == modal) {
  33. modal.style.display = "none";
  34. }
  35. }
  36. document.getElementById('client').value = info[i][0];
  37. document.getElementById('date').value = info[i][1];
  38. document.getElementById('sum').value = info[i][2];
  39. document.getElementById('val').value = info[i][3];
  40. }
Add Comment
Please, Sign In to add comment