MediaWiki:WikiTable.css: Difference between revisions
From The Seven Sages of Rome
No edit summary Tag: Reverted |
No edit summary Tag: Manual revert |
||
Line 1: | Line 1: | ||
/* Modern WikiTable Styles | /* Modern WikiTable Styles */ | ||
.wikitable { | .wikitable { | ||
background-color: #ffffff; | background-color: #ffffff; | ||
Line 5: | Line 5: | ||
border-spacing: 0; | border-spacing: 0; | ||
margin: 1em 0; | margin: 1em 0; | ||
border-radius: 10px; | |||
box-shadow: 0 4px 6px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.1); | |||
width: 100%; | width: 100%; | ||
overflow: hidden; | overflow: hidden; | ||
position: relative; | |||
} | } | ||
/* Table Header | /* Table Header */ | ||
.wikitable > tr > th, | .wikitable > tr > th, | ||
.wikitable > * > tr > th { | .wikitable > * > tr > th { | ||
background-color: # | background-color: #f1f5f9; | ||
border: none; | border: none; | ||
border-bottom: | border-bottom: 2px solid #e2e8f0; | ||
padding: 1rem 0.75rem; | padding: 1rem 0.75rem; | ||
color: # | color: #334155; | ||
font-weight: | font-weight: 700; | ||
text-align: left; | text-align: left; | ||
vertical-align: middle; | vertical-align: middle; | ||
position: sticky; | |||
top: 0; | |||
z-index: 10; | |||
} | |||
/* First header row styling for multi-row headers */ | |||
.wikitable > thead > tr:first-child > th { | |||
background-color: #e2e8f0; | |||
border-bottom: none; | |||
} | } | ||
/* Table Cells | /* Table Cells */ | ||
.wikitable > tr > td, | .wikitable > tr > td, | ||
.wikitable > * > tr > td { | .wikitable > * > tr > td { | ||
border: none; | border: none; | ||
border-bottom: 1px solid # | border-bottom: 1px solid #e2e8f0; | ||
padding: 0.875rem 0.75rem; | padding: 0.875rem 0.75rem; | ||
vertical-align: middle; | vertical-align: middle; | ||
color: # | color: #334155; | ||
} | } | ||
Line 42: | Line 50: | ||
} | } | ||
/* Striped rows | /* Striped rows */ | ||
.wikitable > tr:nth-child(even), | .wikitable > tr:nth-child(even), | ||
.wikitable > * > tr:nth-child(even) { | .wikitable > * > tr:nth-child(even) { | ||
background-color: # | background-color: #f8fafc; | ||
} | } | ||
Line 51: | Line 59: | ||
.wikitable > tbody > tr:hover, | .wikitable > tbody > tr:hover, | ||
.wikitable > * > tbody > tr:hover { | .wikitable > * > tbody > tr:hover { | ||
background-color: # | background-color: #f1f5f9; | ||
transition: background-color 0.2s ease-in-out; | transition: background-color 0.2s ease-in-out; | ||
} | } | ||
Line 68: | Line 76: | ||
-webkit-overflow-scrolling: touch; | -webkit-overflow-scrolling: touch; | ||
margin-bottom: 1.5rem; | margin-bottom: 1.5rem; | ||
border-radius: 10px; | |||
max-height: 80vh; /* For fixed header scrolling */ | |||
} | } | ||
Line 80: | Line 90: | ||
display: inline-block; | display: inline-block; | ||
margin-left: 0.5em; | margin-left: 0.5em; | ||
opacity: 0. | opacity: 0.5; | ||
font-size: 0.875rem; | font-size: 0.875rem; | ||
} | } | ||
Line 97: | Line 107: | ||
.wikitable > caption { | .wikitable > caption { | ||
padding: 0.75rem; | padding: 0.75rem; | ||
color: # | color: #64748b; | ||
text-align: left; | text-align: left; | ||
caption-side: top; | caption-side: top; | ||
font-style: italic; | font-style: italic; | ||
font-weight: 500; | font-weight: 500; | ||
background-color: # | background-color: #f8fafc; | ||
border-bottom: 1px solid # | border-bottom: 1px solid #e2e8f0; | ||
border-radius: 10px 10px 0 0; | |||
} | |||
/* Apply fixed header for the WikiTable */ | |||
.table-fixed-header { | |||
max-height: 600px; | |||
overflow-y: auto; | |||
border-radius: 10px; | |||
} | } | ||
Line 114: | Line 132: | ||
padding: 0.625rem 0.5rem; | padding: 0.625rem 0.5rem; | ||
font-size: 0.875rem; | font-size: 0.875rem; | ||
} | |||
.table-fixed-header { | |||
max-height: 400px; | |||
} | } | ||
} | } |
Revision as of 18:13, 12 March 2025
/* Modern WikiTable Styles */
.wikitable {
background-color: #ffffff;
border-collapse: separate;
border-spacing: 0;
margin: 1em 0;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.1);
width: 100%;
overflow: hidden;
position: relative;
}
/* Table Header */
.wikitable > tr > th,
.wikitable > * > tr > th {
background-color: #f1f5f9;
border: none;
border-bottom: 2px solid #e2e8f0;
padding: 1rem 0.75rem;
color: #334155;
font-weight: 700;
text-align: left;
vertical-align: middle;
position: sticky;
top: 0;
z-index: 10;
}
/* First header row styling for multi-row headers */
.wikitable > thead > tr:first-child > th {
background-color: #e2e8f0;
border-bottom: none;
}
/* Table Cells */
.wikitable > tr > td,
.wikitable > * > tr > td {
border: none;
border-bottom: 1px solid #e2e8f0;
padding: 0.875rem 0.75rem;
vertical-align: middle;
color: #334155;
}
/* Last row has no border */
.wikitable > tr:last-child > td,
.wikitable > * > tr:last-child > td {
border-bottom: none;
}
/* Striped rows */
.wikitable > tr:nth-child(even),
.wikitable > * > tr:nth-child(even) {
background-color: #f8fafc;
}
/* Hover effect */
.wikitable > tbody > tr:hover,
.wikitable > * > tbody > tr:hover {
background-color: #f1f5f9;
transition: background-color 0.2s ease-in-out;
}
/* First column styling */
.wikitable > tr > td:first-child,
.wikitable > * > tr > td:first-child {
font-weight: 500;
}
/* Responsive table wrapper */
.table-responsive {
display: block;
width: 100%;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
margin-bottom: 1.5rem;
border-radius: 10px;
max-height: 80vh; /* For fixed header scrolling */
}
/* Sort indicators if sortable tables are used */
.wikitable th.headerSort {
cursor: pointer;
position: relative;
}
.wikitable th.headerSort:after {
content: '⇅';
display: inline-block;
margin-left: 0.5em;
opacity: 0.5;
font-size: 0.875rem;
}
.wikitable th.headerSortUp:after {
content: '↑';
opacity: 1;
}
.wikitable th.headerSortDown:after {
content: '↓';
opacity: 1;
}
/* Caption styling */
.wikitable > caption {
padding: 0.75rem;
color: #64748b;
text-align: left;
caption-side: top;
font-style: italic;
font-weight: 500;
background-color: #f8fafc;
border-bottom: 1px solid #e2e8f0;
border-radius: 10px 10px 0 0;
}
/* Apply fixed header for the WikiTable */
.table-fixed-header {
max-height: 600px;
overflow-y: auto;
border-radius: 10px;
}
/* Mobile optimizations */
@media (max-width: 768px) {
.wikitable > tr > th,
.wikitable > * > tr > th,
.wikitable > tr > td,
.wikitable > * > tr > td {
padding: 0.625rem 0.5rem;
font-size: 0.875rem;
}
.table-fixed-header {
max-height: 400px;
}
}
/* For two-column layout adjustments */
.container-fluid .row .col-md-6 {
padding-left: 0.75rem;
padding-right: 0.75rem;
}
/* Increase spacing between tables */
.wikitable.mb-4 {
margin-bottom: 1.5rem !important;
}
/* Optional: Property-value column alignment for better readability */
.wikitable > tbody > tr > td:first-of-type {
width: 40%;
}
.wikitable > tbody > tr > td:last-of-type {
width: 60%;
}