MediaWiki:Common.css: Difference between revisions

From Amberlynn Wiki
Jump to navigation Jump to search
Created page with "CSS placed here will be applied to all skins: <div class="responsive-table"> {| class="wikitable" style="display: flex; flex-wrap: wrap; width: 100%;" |- | Cell 1 || Cell 2 || Cell 3 || Cell 4 || Cell 5 || Cell 6 |} </div> <style> .responsive-table table { border-collapse: collapse; } .responsive-table td { border: 1px solid black; padding: 8px; flex: 1 1 16.66%; Each cell takes ~1/6th of the width initially: box-sizing: border-box; } /* M..."
 
No edit summary
Line 1: Line 1:
/* CSS placed here will be applied to all skins */
/* Ensure only this table is affected */
<div class="responsive-table">
.eras-table {
{| class="wikitable" style="display: flex; flex-wrap: wrap; width: 100%;"
    display: flex;
|-
    flex-wrap: wrap;
| Cell 1 || Cell 2 || Cell 3 || Cell 4 || Cell 5 || Cell 6
    width: 100%;
|}
}
</div>


<style>
/* Style individual cells */
.responsive-table table {
.eras-table td {
     border-collapse: collapse;
     flex: 1 1 16.66%; /* 6 columns: ~1/6th width each */
    box-sizing: border-box;
    text-align: center; /* Keeps images and text centered */
    min-width: 0; /* Prevents overflow issues with images */
}
}
.responsive-table td {
 
    border: 1px solid black;
/* Header spans full width always */
    padding: 8px;
.eras-table th {
     flex: 1 1 16.66%; /* Each cell takes ~1/6th of the width initially */
     flex: 1 1 100%;
    box-sizing: border-box;
}
}


/* Medium resolution/zoom: 3 columns, 2 rows */
/* Medium resolution/zoom: 3 columns, 2 rows */
@media (max-width: 800px) {
@media (max-width: 800px) {
     .responsive-table td {
     .eras-table td {
         flex: 1 1 33.33%; /* Each cell takes ~1/3rd of the width */
         flex: 1 1 33.33%; /* 3 columns: ~1/3rd width each */
     }
     }
}
}
Line 27: Line 28:
/* Small resolution/max zoom: 1 column, 6 rows */
/* Small resolution/max zoom: 1 column, 6 rows */
@media (max-width: 400px) {
@media (max-width: 400px) {
     .responsive-table td {
     .eras-table td {
         flex: 1 1 100%; /* Each cell takes full width */
         flex: 1 1 100%; /* 1 column: full width */
     }
     }
}
}
</style>

Revision as of 11:39, 27 February 2025

/* Ensure only this table is affected */
.eras-table {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

/* Style individual cells */
.eras-table td {
    flex: 1 1 16.66%; /* 6 columns: ~1/6th width each */
    box-sizing: border-box;
    text-align: center; /* Keeps images and text centered */
    min-width: 0; /* Prevents overflow issues with images */
}

/* Header spans full width always */
.eras-table th {
    flex: 1 1 100%;
}

/* Medium resolution/zoom: 3 columns, 2 rows */
@media (max-width: 800px) {
    .eras-table td {
        flex: 1 1 33.33%; /* 3 columns: ~1/3rd width each */
    }
}

/* Small resolution/max zoom: 1 column, 6 rows */
@media (max-width: 400px) {
    .eras-table td {
        flex: 1 1 100%; /* 1 column: full width */
    }
}