Created
February 7, 2014 21:05
-
-
Save tomkrush/8871848 to your computer and use it in GitHub Desktop.
Calculating Columns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function calculateColumnWidth($maxWidth, $columns, $gutter, $margin) { | |
return floor(($maxWidth-(($columns - 1) * $gutter + 2 * $margin)) / $columns); | |
} | |
echo calculateColumnWidth(960, 5, 20, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment