Guest User

Untitled

a guest
Dec 6th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. # userName = ['Name1', 'Name2']
  2. userName = ['Name1', 'Name2', 'Name3', 'Name4', 'Name5', 'Name6', 'Name7', 'Name8']
  3. # userName = ['Name1', 'Name2', 'Name3']
  4.  
  5. html_card = ''
  6. for count, element in enumerate(userName, 1): # Start counting from 1
  7.  
  8. # ADDING HTML ROW
  9. if count % 4 == 0 or count == 1:
  10. html_card += '<div class="row">'
  11.  
  12. # ADDING HTML CARD COL
  13. html_card += '''n<div class="col">
  14. <div class="card card-block">
  15. <div class="card mb-4 border-primary">
  16. <div class="card-header bg-primary">{element}</div>
  17. <div class="card-body text-primary">
  18. <h4 style="color:#0069d9" class="card-title">{element} Performance Runs</h4>
  19. <p style="color:#0069d9" class="card-text"></p>
  20. <button type="button" class="btn btn-primary" value="Show Div" onclick="showDiv()">Available Runs</button>
  21. </div>
  22. </div>
  23. </div>
  24. </div>n'''.format(element=element)
  25.  
  26. # ADDING HTML ROW DIV
  27. if count % 4 == 0 or element == userName[-1]:
  28. html_card += '</div>n'
  29.  
  30. print(html_card)
Add Comment
Please, Sign In to add comment