table header sticky top

This commit is contained in:
Owen Rees
2023-06-10 11:42:58 +02:00
parent 1ad2f1b306
commit fbefd7eaa0
7 changed files with 16 additions and 14 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ import Link from "next/link";
export default function Navbar() {
return (
<nav className="bg-gray-800 mt-0 w-full">
<nav className="bg-gray-800 pt-5 mt-0 w-full md:pt-2 px-5">
<div className="container mx-auto flex flex-wrap items-center">
<div className="flex w-full md:w-1/2 justify-center md:justify-start text-white font-extrabold">
<Link
@@ -12,7 +12,7 @@ export default function Navbar() {
<span className="text-2xl pl-2">Echecs France</span>
</Link>
</div>
<div className="flex w-full pt-2 content-center justify-between md:w-1/2 md:justify-end">
<div className="flex w-full pt-2 justify-center md:w-1/2 md:justify-end">
<ul className="list-reset text-white no-underline flex flex-1 md:flex-none items-center">
<li className="mr-10">
<Link
@@ -30,7 +30,7 @@ export default function Navbar() {
About
</Link>
</li>
<li className="mr-10">
<li className="">
<Link
className="inline-block border-b-4 py-5 border-transparent hover:border-teal-600 transition-all ease-in-out duration-300"
href="/contact"
+1 -1
View File
@@ -24,7 +24,7 @@ export default function TournamentMap({ tournamentData }: TournamentDataProps) {
return (
<section
id="tournament-map"
className="grid h-[calc(100vh-108px)] md:h-[calc(100vh-76px)]"
className="grid h-[calc(100vh-128px)] md:h-[calc(100vh-82px)] lg:h-[calc(100vh-132px)]"
>
<MapContainer
center={center}
+7 -7
View File
@@ -19,19 +19,19 @@ export default function TournamentTable({
return (
<section
id="tournament-table"
className="w-full lg:col-start-2 lg:col-end-3"
className="w-full grid h-[calc(100vh-176px)] md:h-[calc(100vh-82px)] lg:h-[calc(100vh-132px)] lg:col-start-2 lg:col-end-3"
>
<SearchBar
tournamentFilter={tournamentFilter}
setTournamentFilter={setTournamentFilter}
/>
<table className="table-fixed w-full text-center text-xs">
<table className="relative table-fixed w-full text-center text-xs">
<thead className="bg-gray-600 text-white">
<tr className="">
<th className="p-3">Date</th>
<th className="p-3">Ville</th>
<th className="p-3">Tournois</th>
<th className="p-3">Cadence</th>
<tr>
<th className="sticky top-0 p-3 bg-gray-600">Date</th>
<th className="sticky top-0 p-3 bg-gray-600">Ville</th>
<th className="sticky top-0 p-3 bg-gray-600">Tournois</th>
<th className="sticky top-0 p-3 bg-gray-600">Cadence</th>
</tr>
</thead>
<tbody>{filteredTournamentData}</tbody>