Skip to content

Commit

Permalink
Add background color for alternate rows in tables
Browse files Browse the repository at this point in the history
  • Loading branch information
karenc committed Aug 7, 2011
1 parent 39503ee commit f540ad3
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 8 deletions.
12 changes: 12 additions & 0 deletions src/static/css/main.css
Expand Up @@ -78,3 +78,15 @@ FORM {
padding: 10px 5px; padding: 10px 5px;
border-top: 2px solid #9BE; border-top: 2px solid #9BE;
} }

TABLE {
margin: 20px 0;
}

TH, TD {
padding: 5px 8px;
}

TR.even {
background-color: #ACE;
}
3 changes: 3 additions & 0 deletions src/static/js/main.js
@@ -0,0 +1,3 @@
jQuery(document).ready(function() {
jQuery('table.with-color tr:even').addClass('even');
});
2 changes: 1 addition & 1 deletion src/templates/clues.html
Expand Up @@ -18,7 +18,7 @@ <h1>Clues for {{ hunt_name }}</h1>
<div class="tab-content"> <div class="tab-content">
{% if started %} {% if started %}
<form action="" method="post"> <form action="" method="post">
<table> <table class="with-color">
<tr> <tr>
<th>Question</th> <th>Question</th>
<th>Answer</th> <th>Answer</th>
Expand Down
6 changes: 1 addition & 5 deletions src/templates/hunt.html
Expand Up @@ -20,11 +20,7 @@ <h2>Hunt has started!</h2>
<input type="submit" value="Start hunt" /> <input type="submit" value="Start hunt" />
</form> </form>
{% endif %} {% endif %}
<div> <table class="with-color">
<a href="/hunt/{{ hunt.key.id }}/clues">Clues</a>
<a href="/hunt/{{ hunt.key.id }}/teams">Teams</a>
</div>
<table>
<tr><th>Question/Team</th> <tr><th>Question/Team</th>
{% for team in hunt.teams %} {% for team in hunt.teams %}
<th>{{ team.name }}</th> <th>{{ team.name }}</th>
Expand Down
2 changes: 2 additions & 0 deletions src/templates/include-head.html
@@ -1 +1,3 @@
<script type="text/javascript" src="/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="/js/main.js"></script>
<link rel="stylesheet" href="/css/main.css" type="text/css" media="screen" /> <link rel="stylesheet" href="/css/main.css" type="text/css" media="screen" />
2 changes: 1 addition & 1 deletion src/templates/index.html
Expand Up @@ -17,7 +17,7 @@ <h2>Create a new Hunt:</h2>
</div> </div>
<div> <div>
<h2>Your Hunts:</h2> <h2>Your Hunts:</h2>
<table> <table class="with-color">
<tr> <tr>
<th style="width: 130px">Hunt Name</th> <th style="width: 130px">Hunt Name</th>
<th style="width: 130px">Status</th> <th style="width: 130px">Status</th>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/teams.html
Expand Up @@ -18,7 +18,7 @@ <h1>Teams for {{ hunt_name }}</h1>
<div class="tab-content"> <div class="tab-content">
{% if started %} {% if started %}
<form action="" method="post"> <form action="" method="post">
<table> <table class="with-color">
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Phone Number</th> <th>Phone Number</th>
Expand Down

0 comments on commit f540ad3

Please sign in to comment.