2017年6月28日水曜日

開発環境

Head First HTML and CSS (Elisabeth Robson(著)、Eric Freeman(著)、O'Reilly Media)の Chapter 13.(Tables and More Lists: Getting Tabular)、BRAIN BARBELL(No. 9553) を取り組んでみる。

BRAIN BARBELL(No. 9553)

City Date Temperature Altitude Population Diner Rating
Walla Walla, WA June 15th 75 1,204 ft 29,686 4/5
Magic City, ID June 25th 74 5,312 ft 50 3/5
Bountiful, UT July 10th 91 4,226 ft 41, 173 4/5
Last Chance, CO July 23rd 102 4,780 ft 265 3/5
Truth or Consequences, NM August 9th 93 4,242 ft 7,289 5/5
August 27th 93
Tess 5/5
Tony 4/5
Why, AZ August 18th 104 860 ft 480 3/5

HTML5

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="journal.css">
    <title>Testing Tony's Travels</title>
  </head>
  <body>
    <table>
      <tr>
        <th>City</th>
        <th>Date</th>
        <th>Temperature</th>
        <th>Altitude</th>
        <th>Population</th>
        <th>Diner Rating</th>
      </tr>
      <tr>
        <td>Walla Walla, WA</td>
        <td class="center0">June 15th</td>
        <td class="center0">75</td>
        <td class="right0">1,204 ft</td>
        <td class="right0">29,686</td>
        <td class="center0">4/5</td>
      </tr>
      <tr class="cellcolor">
        <td>Magic City, ID</td>
        <td class="center0">June 25th</td>
        <td class="center0">74</td>
        <td class="right0">5,312 ft</td>
        <td class="right0">50</td>
        <td class="center0">3/5</td>
      </tr>
      <tr>
        <td>Bountiful, UT</td>
        <td class="center0">July 10th</td>
        <td class="center0">91</td>
        <td class="right0">4,226 ft</td>
        <td class="right0">41, 173</td>
        <td class="center0">4/5</td>
      </tr>
      <tr class="cellcolor">
        <td>Last Chance, CO</td>
        <td class="center0">July 23rd</td>
        <td class="center0">102</td>
        <td class="right0">4,780 ft</td>
        <td class="right0">265</td>
        <td class="center0">3/5</td>
      </tr>
      <tr>
        <td rowspan="2">Truth or Consequences, NM</td>
        <td class="center0">August 9th</td>
        <td class="center0">93</td>
        <td rowspan="2" class="right0">4,242 ft</td>
        <td rowspan="2" class="right0">7,289</td>
        <td class="center0">5/5</td>
      </tr>
      <tr>
        <td class="center0">August 27th</td>
        <td class="center0">93</td>
        <td>
          <table>
            <tr>
              <th>Tess</th>
              <td>5/5</td>
            </tr>
            <tr>
              <th>Tony</th>
              <td>4/5</td>
            </tr>
          </table>
        </td>
      </tr>
      <tr class="cellcolor">
        <td>Why, AZ</td>
        <td class="center0">August 18th</td>
        <td class="center0">104</td>
        <td class="right0">860 ft</td>
        <td class="right0">480</td>
        <td class="center0">3/5</td>
      </tr>
    </table>
  </body>
</html>

CSS(Stylehseet)

table {
    border-spacing: 0px;
}
td, th {
    border: thin dotted gray;
}
.center0 {
    text-align: center;
}
.right0 {
    text-align: right;
}
th {
    background-color: #cc6600;
}
.cellcolor {
    background-color: #fcba7a;
}
table table th {
    background-color: white;
}

0 コメント:

コメントを投稿