Hutchy68 / pivot

A MediaWiki mobile skin which "Pivots" seamlessly to any size display.
https://pivot.wikiproject.net
BSD 2-Clause "Simplified" License
37 stars 18 forks source link

Grid: How to center multiple columns #63

Closed Lithimlin closed 6 years ago

Lithimlin commented 6 years ago

Setup

Issue

I am trying to use the Grid, but I need 13 columns. Thus I created 3 collumns and within the middle one 11 more which I was trying to center. But if I put <div class="small-1 small-centered columns nopad">1</div>, it results in "1" being alone in the middle and everything else being in the next row.

<div class="small-1 columns nopad"> Sandbox </div>
<div class="small-10 columns nopad">
                <div class="small-1 small-centered columns nopad">0</div>
                <div class="small-1 small-centered columns nopad">1</div>
                <div class="small-1 small-centered columns nopad">2</div>
                <div class="small-1 small-centered columns nopad">3</div>
                <div class="small-1 small-centered columns nopad">4</div>
                <div class="small-1 small-centered columns nopad">5</div>
                <div class="small-1 small-centered columns nopad">6</div>
                <div class="small-1 small-centered columns nopad">7</div>
                <div class="small-1 small-centered columns nopad">8</div>
                <div class="small-1 small-centered columns nopad">9</div>
                <div class="small-1 small-centered columns nopad">10</div>
</div>
<div class="small-1 columns nopad">Linear</div>

This results in "Sanbox" being linear, then 0-10 underneath each other, centered, and "Linear" on the right.

Hutchy68 commented 6 years ago

But your "column 2" only has 11 columns. Everything needs to total 12, even sub divs. So what you should do is 1 & 11 and the 11 column width should sub 12 for a total of 13 columns.

Here is how to do 13 columns and center them. I think you want to text-align content to the center. Not center the column itself. Anyway, see https://pivot.wikiproject.net/wiki/User:Hutchy68/13_Columns for the demo and explanation on how.

Lithimlin commented 6 years ago

Thanks a lot!

kghbln commented 6 years ago

Here is how to do 13 columns and center them. I think you want to text-align content to the center. Not center the column itself. Anyway, see https://pivot.wikiproject.net/wiki/User:Hutchy68/13_Columns for the demo and explanation on how.

To me this demo looks like it could be added to an "official" wiki page rather than to a "private" subpage.