table-digital.html 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>table</title>
  6. <link rel="stylesheet" href="/static/css/bootstrap.min.css">
  7. <script src="/static/js/jquery-3.1.1.min.js"></script>
  8. <script src="/static/js/bootstrap.min.js"></script>
  9. </head>
  10. <body>
  11. <div id="tableDiv" class="table-responsive" style="height: calc(100% - 5px);overflow:scroll">
  12. <table class="table table-striped">
  13. <thead>
  14. <tr>
  15. {% for key in chList %}
  16. <th>{{key}}</th>
  17. {% endfor %}
  18. <th>通知</th>
  19. </tr>
  20. </thead>
  21. <tbody>
  22. {% for key, values in data.items() %}
  23. <tr class="active">
  24. <td>{{key}}</td>
  25. {% for k, v in values.items() %}
  26. <td>{{v}}</td>
  27. {% endfor %}
  28. <td><button class="btn-info" type="button" onclick="sendMsgNo({{key}})">发送</button></td>
  29. </tr>
  30. {% endfor %}
  31. </tbody>
  32. </table>
  33. </div>
  34. <script>
  35. // $("#tableDiv").height($("#moveItemDigital_body").height()-60);
  36. function sendMsgNo(key){
  37. $.post('/sendMsgNo', {'no':key}, function (data, status){
  38. console.log("sendMsgNo:"+data+status)
  39. })
  40. }
  41. </script>
  42. </body>
  43. </html>