Re: [css3-multicol] pseudo-algorithm

On Feb 15, 2011, at 7:36 PM, Sylvain Galineau wrote:

> Let's use the following values as inputs:
> 
> column-count:8;
> column-gap:50px;
> column-width:auto;


> Using the current algorithm in the WD [2] instead, we have:
> 
> (24)      N := floor(available-width/column-gap);
> (25)      W := (available-width - ((N - 1) * column-gap))/N;
> 
> Which gives us:
> 
>   ! 350px ! 349px ! 325px ! 300px ! 275px ! 250px ! 225px ! 200px !
> ---!-------!-------!-------!-------!-------!-------!-------!-------!
> N  !     7 !     6 !     6 !     6 !     5 !     5 !     4 !     4 !
> ---!-------!-------!-------!-------!-------!-------!-------!-------!
> W  ! 7.1px ! 16.5px! 12.5px! 8.3px !  15px !  10px ! 18.7px! 12.5px!
> ---!-------!-------!-------!-------!-------!-------!-------!-------!
> 

I wish the "pseudo-algorithm" was explained in the spec in clear English. I didn't realize before this thread (mostly because I find it hard to read and make sense of that algorithm) that the number of columns could be less than what the author asked for, even though he has indicated that the width should be automatically sized to allow it. I find it strange that an author could ask for 8 columns and end up with 4, and that there is nothing he can do about that, short of having a media query that changes the gap size.

Received on Wednesday, 16 February 2011 17:07:20 UTC