Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Fixed table scroll on mobile screen
Browse files Browse the repository at this point in the history
  • Loading branch information
eoussama committed Jan 12, 2024
1 parent 9fd6a74 commit ca10164
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 35 deletions.
68 changes: 35 additions & 33 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,39 +235,41 @@ <h5 class="card-title">Countries and Provinces Ranked by Total Cases</h5>
</div>

<div class="card-body">
<table class="table table-striped">
<thead class="table-light">
<tr>
<th
class="rank"
scope="col"
>#</th>

<th
class="country"
scope="col"
>Country</th>

<th
class="province"
scope="col"
>Province</th>

<th
class="cases"
scope="col"
>Total Cases</th>

<th
class="deaths"
scope="col"
>Total Deaths</th>
</tr>
</thead>

<tbody id="table-body">
</tbody>
</table>
<div class="table-responsive">
<table class="table table-striped">
<thead class="table-light">
<tr>
<th
class="rank"
scope="col"
>#</th>

<th
class="country"
scope="col"
>Country</th>

<th
class="province"
scope="col"
>Province</th>

<th
class="cases"
scope="col"
>Total Cases</th>

<th
class="deaths"
scope="col"
>Total Deaths</th>
</tr>
</thead>

<tbody id="table-body">
</tbody>
</table>
</div>
</div>
</div>
</div>
Expand Down
11 changes: 9 additions & 2 deletions src/styles/table.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
.table-responsive {
margin-top: -15px;
}

.table {
margin-bottom: 0;
margin-top: -15px;

overflow: hidden;
border-radius: 10px;

--bs-table-color: #53567e;
--bs-table-striped-color: #53567e;

--bs-table-bg: #dfdfff;
--bs-table-striped-bg: #e6e6ff;
}
Expand All @@ -17,6 +20,10 @@
--bs-table-color: #53567e;
}

.table thead th {
white-space: nowrap;
}

.table tbody td {
text-transform: capitalize;
}
Expand Down

0 comments on commit ca10164

Please sign in to comment.