Displaying Table
Displaying Table
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hackers Data</title>
<style>
body {
font-family: 'Arial', sans-serif;
margin: 0;
padding: 0;
background: linear-gradient(to right, #1e3c72, #2a5298);
color: #ffffff;
}
h1 {
text-align: center;
margin: 20px 0;
color: #f8f8f8;
}
.container {
width: 90%;
margin: 0 auto;
max-width: 1200px;
}
.filter-form {
display: flex;
justify-content: space-between;
align-items: center;
background: #ffffff;
padding: 15px 20px;
border-radius: 8px;
margin-bottom: 20px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
color: #333;
}
.filter-form label {
margin-right: 10px;
font-weight: bold;
}
.filter-form input,
.filter-form select,
.filter-form button {
padding: 8px 12px;
border-radius: 6px;
border: 1px solid #ddd;
font-size: 14px;
color: #333;
}
.filter-form select {
background-color: #f8f8f8;
}
.filter-form button {
background-color: #3182ce;
color: #ffffff;
border: none;
cursor: pointer;
transition: background-color 0.3s ease;
}
.filter-form button:hover {
background-color: #2563eb;
}
table {
border-collapse: collapse;
width: 100%;
background: #f9f9f9;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
th, td {
border: 1px solid #ddd;
padding: 12px 15px;
text-align: left;
}
td{
color: #4d4d4d;
}
th {
background-color: #2a5298;
color: #ffffff;
}
tr:nth-child(even) {
background-color: #f9f9f9;
}
tr:hover {
background-color: #e5e5e5;
}
.pagination {
display: flex;
justify-content: center;
list-style: none;
padding: 15px 0;
}
.pagination li {
margin: 0 5px;
}
.pagination li a {
text-decoration: none;
padding: 8px 12px;
background-color: #3182ce;
color: #ffffff;
border-radius: 6px;
}
.pagination li a:hover {
background-color: #2563eb;
}
</style>
</head>
<body>
<div class="container">
<h1>Hackers Data</h1>
<div>
<label for="sortField">Sort by:</label>
<select name="sortField" id="sortField">
<option value="id" {{ $sortField === 'id' ? 'selected' :
'' }}>ID</option>
<option value="name" {{ $sortField === 'name' ? 'selected' : ''
}}>Name</option>
<option value="alias" {{ $sortField === 'alias' ? 'selected' :
'' }}>Alias</option>
<option value="specialty" {{ $sortField === 'specialty' ?
'selected' : '' }}>Specialty</option>
<option value="country" {{ $sortField === 'country' ?
'selected' : '' }}>Country</option>
</select>
</div>
<div>
<label for="sortOrder">Order:</label>
<select name="sortOrder" id="sortOrder">
<option value="asc" {{ $sortOrder === 'asc' ? 'selected' :
'' }}>Ascending</option>
<option value="desc" {{ $sortOrder === 'desc' ? 'selected' : ''
}}>Descending</option>
</select>
</div>
<div>
<label for="perPage">Entries per page:</label>
<select name="perPage" id="perPage">
<option value="5" {{ $perPage == 5 ? 'selected' : ''
}}>5</option>
<option value="10" {{ $perPage == 10 ? 'selected' : ''
}}>10</option>
<option value="25" {{ $perPage == 25 ? 'selected' : ''
}}>25</option>
<option value="50" {{ $perPage == 50 ? 'selected' : ''
}}>50</option>
</select>
</div>
<button type="submit">Apply</button>
</form>
</html>