Advertisement
supportnwl

Events List alternating color

Oct 7th, 2012
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. You can try this one:
  2.  
  3. e.g.
  4.  
  5. In your formats/layouts > events format:
  6.  
  7. Default event list format header:
  8. <table cellpadding="0" cellspacing="0" class="events-table" >
  9. <thead>
  10. <tr>
  11. <th class="event-time" width="150">Date/Time</th>
  12. <th class="event-description" width="*">Event</th>
  13. </tr>
  14. </thead>
  15. <tbody>
  16.  
  17. Default event list format:
  18. <tr>
  19. <td>
  20. #_EVENTDATES<br/>
  21. #_EVENTTIMES
  22. </td>
  23. <td>
  24. #_EVENTLINK
  25. {has_location}<br/><i>#_LOCATIONNAME, #_LOCATIONTOWN #_LOCATIONSTATE</i>{/has_location}
  26. </td>
  27. </tr>
  28.  
  29.  
  30. Default event list format footer:
  31. </tbody></table>
  32.  
  33.  
  34. Then in your theme style.css:
  35. table.events-table thead {
  36. background-color: black;
  37. color: white;
  38. text-indent: 14px;
  39. text-align: left;
  40. }
  41.  
  42. table.events-table tbody tr:nth-child(odd) {
  43. background-color: rgba(0, 255, 0, 0.1); /* green, 10% alpha */
  44. }
  45.  
  46. table.events-table tbody tr:nth-child(even) {
  47. background-color: rgba(255, 0, 0, 0.3); /* red, 30% alpha */
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement