<?php

/**
 * gera divs com float e clearfix, simulando uma tabela
 * 
 * @package iris
 * @author teste
 * @copyright 2011
 * @version 1.0
 * @access public
 */
class DivTable {
	
	/**
	 * DivTable::createDivTable()
	 * 
	 * @param int $cols
	 * @param array $size
	 * @return String
	 */
	public function createDivTable($cols, $size){
		$str = '';
		$str .= '<div class="clearfix">';
		
		for($i = 0; $i < $cols; $i++){
			$style = '';
			foreach($size[$i] as $k => $c){
				$style .= $k . ': ' . $c . ';';
			}
			$str .= '
	<div class="fl" style="'.$style.'">';
			
			$str .= '
	
	</div>';
		}
		
		$str .= '
</div>';
		
		return $str;
	}
}

$a1 = array(
	array('background' => "url(images/iris_0x5.jpg)", 'width' => '505px', 'height' => '584px'),
	array('background' => "url(images/iris_06.jpg)", 'width' => '35px', 'height' => '584px'),
	array('background' => "url(images/iris_07.jpg)", 'width' => '353px', 'height' => '584px')
);

$dt = new DivTable;
echo $dt->createDivTable(3, $a1);
?>