/ Published in: PHP
Code explains itself. I plan to do a lot more work on it - just wanted to throw it up here for a little sharing. Feel free to take it to the next level.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $columns = 4; $column_size = 215; $column_gutter = 20; $sizes = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen'); for($n = 1; $n <= $columns; $n++) { echo $sizes[$n - 1] ." { "; echo "width: " . ($column_size * $n + $column_gutter * ($n - 1) ) . "px; "; foreach($rule as $property => $value): echo "$property: $value; "; endforeach; echo "} \n"; } /* End of file grid.php */