W3C home > Mailing lists > Public > www-style@w3.org > February 2011

Re: [css3-multicol] pseudo-algorithm

From: Brad Kemper <brad.kemper@gmail.com>
Date: Wed, 16 Feb 2011 09:06:18 -0800
Cc: Håkon Wium Lie <howcome@opera.com>, Stephen Zilles <szilles@adobe.com>, "www-style@w3.org" <www-style@w3.org>
Message-Id: <6CB7D291-1E9F-4268-85B9-EE43F380D076@gmail.com>
To: Sylvain Galineau <sylvaing@microsoft.com>

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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:37 GMT