MediaWiki:WikiTable.css: Difference between revisions
From The Seven Sages of Rome
(Created page with "→Modern WikiTable Styles: .wikitable { background-color: #ffffff; border-collapse: collapse; margin: 1em 0; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); width: 100%; } .wikitable > tr > th, .wikitable > * > tr > th { background-color: #f8f9fa; border: 1px solid #dee2e6; padding: 0.75rem; color: #495057; font-weight: 600; text-align: left; vertical-align: middle; } .wikita...") |
No edit summary Tag: Manual revert |
||
(24 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
/* Modern WikiTable Styles */ | /* Modern WikiTable Styles */ | ||
.wikitable { | .wikitable { | ||
background-color: # | background-color: #f8f8f8; | ||
border-collapse: | border-collapse: separate; | ||
border-spacing: 0; | |||
margin: 1em 0; | margin: 1em 0; | ||
width: 100%; | width: 100%; | ||
position: relative; | |||
} | } | ||
/* Table Header */ | |||
.wikitable > tr > th, | .wikitable > tr > th, | ||
.wikitable > * > tr > th { | .wikitable > * > tr > th { | ||
background-color: # | background-color: #f8f8f8; | ||
border: | border: none; | ||
padding: 0.75rem; | border-bottom: 2px solid #e2e8f0; | ||
color: | padding: 1rem 0.75rem; | ||
font-weight: | color: black; | ||
font-size: 1.1rem; | |||
font-weight: 700; | |||
text-align: left; | text-align: left; | ||
vertical-align: middle; | vertical-align: middle; | ||
} | } | ||
/* First header row styling for multi-row headers */ | |||
.wikitable > thead > tr:first-child > th { | |||
background-color: #ffffff; | |||
border-bottom: none; | |||
} | |||
/* Table Cells */ | |||
.wikitable > tr > td, | .wikitable > tr > td, | ||
.wikitable > * > tr > td { | .wikitable > * > tr > td { | ||
border: 1px solid # | border: none; | ||
padding: 0.75rem; | border-bottom: 1px solid #e2e8f0; | ||
padding: 0.875rem 0.75rem; | |||
vertical-align: middle; | vertical-align: middle; | ||
color: # | 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), | ||
.wikitable > * > tr:nth-child(even) { | .wikitable > * > tr:nth-child(even) { | ||
background-color: | background-color: #ffffff; | ||
} | |||
/* Hover effect */ | |||
.wikitable > tbody > tr:hover, | |||
.wikitable > * > tbody > tr:hover { | |||
background-color: #f1f5f9; | |||
transition: background-color 0.2s ease-in-out; | |||
} | } | ||
.wikitable > tr: | /* First column styling */ | ||
.wikitable > * > tr: | .wikitable > tr > td:first-child, | ||
.wikitable > * > tr > td:first-child { | |||
font-weight: 500; | |||
} | } | ||
Line 45: | Line 70: | ||
overflow-x: auto; | overflow-x: auto; | ||
-webkit-overflow-scrolling: touch; | -webkit-overflow-scrolling: touch; | ||
margin-bottom: | margin-bottom: 1.5rem; | ||
border-radius: 10px; | |||
max-height: 80vh; /* For fixed header scrolling */ | |||
} | } | ||
Line 51: | Line 78: | ||
.wikitable th.headerSort { | .wikitable th.headerSort { | ||
cursor: pointer; | cursor: pointer; | ||
position: relative; | |||
} | } | ||
.wikitable th.headerSort:after { | .wikitable th.headerSort:after { | ||
content: ' | content: '⇅'; | ||
display: inline-block; | display: inline-block; | ||
margin-left: 0.5em; | margin-left: 0.5em; | ||
opacity: 0.5; | opacity: 0.5; | ||
font-size: 0.875rem; | |||
} | } | ||
Line 73: | Line 102: | ||
.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; | ||
border-bottom: | 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; | |||
} | } | ||
Line 86: | Line 125: | ||
.wikitable > tr > td, | .wikitable > tr > td, | ||
.wikitable > * > tr > td { | .wikitable > * > tr > td { | ||
padding: 0.5rem; | 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%; | |||
} | } |
Latest revision as of 18:57, 26 March 2025
/* Modern WikiTable Styles */
.wikitable {
background-color: #f8f8f8;
border-collapse: separate;
border-spacing: 0;
margin: 1em 0;
width: 100%;
position: relative;
}
/* Table Header */
.wikitable > tr > th,
.wikitable > * > tr > th {
background-color: #f8f8f8;
border: none;
border-bottom: 2px solid #e2e8f0;
padding: 1rem 0.75rem;
color: black;
font-size: 1.1rem;
font-weight: 700;
text-align: left;
vertical-align: middle;
}
/* First header row styling for multi-row headers */
.wikitable > thead > tr:first-child > th {
background-color: #ffffff;
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: #ffffff;
}
/* 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%;
}