Skip to content

Commit 50e7cde

Browse files
committed
Improve styling and mobile-friendliness
1 parent 8d54e8e commit 50e7cde

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

index.html

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<meta charset="UTF-8">
4+
<meta charset="UTF-8"/>
5+
<meta name="viewport" content="width=device-width, initial-scale=1"/>
56
<title>Valg</title>
67
<link rel="stylesheet" href="style.css">
78
<script type="text/javascript" src="data2021.js"></script>
@@ -57,15 +58,19 @@ <h1>Valgsimulator</h1>
5758
</span>
5859
</fieldset>
5960
<h2>Stemmefordeling</h2>
60-
<table id="votes">
61-
<thead></thead>
62-
<tbody></tbody>
63-
</table>
61+
<div class="tablecontainer">
62+
<table id="votes">
63+
<thead></thead>
64+
<tbody></tbody>
65+
</table>
66+
</div>
6467
<h2>Mandatfordeling</h2>
65-
<table id="seats">
66-
<thead></thead>
67-
<tbody></tbody>
68-
</table>
68+
<div class="tablecontainer">
69+
<table id="seats">
70+
<thead></thead>
71+
<tbody></tbody>
72+
</table>
73+
</div>
6974
<h2>Kilder</h2>
7075
<ul>
7176
<li><a href="https://valgresultat.no/valg/2021/">Offisielle stemmetall og valgresultater</a></li>

style.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ body {
22
font-family: sans;
33
}
44

5+
.tablecontainer {
6+
overflow-x: auto;
7+
}
8+
59
table {
610
border-collapse: collapse;
711
}
@@ -11,6 +15,7 @@ th, td {
1115
padding: 0.25em;
1216
text-align: right;
1317
white-space: nowrap;
18+
min-width: 2em;
1419
}
1520

1621
th:first-child {
@@ -29,6 +34,7 @@ fieldset {
2934
row-gap: 0.75em;
3035
column-gap: 2em;
3136
}
37+
3238
fieldset > p{
3339
width: 100%;
3440
margin: 0;

0 commit comments

Comments
 (0)