Advertisement

Dynamic Table With Smarty Engine Template

February 1st, 2010 Admin No comments

Usually I make a dynamic table using PHP, but because it turned out that I handled the project requires use Smarty as template engine, then finally a direct table generated by Smarty. So PHP is only to issue a query from the database.

Here is the template used to create a dynamic table on Smarty.

<table>
	<tr>
	{assign var=\"numCols\" value=\"6\"}
	{assign var=\"col\" value=\"0\"}
	{section name=element loop=$data}
		{if $col == $numCols}
			</tr><tr>{assign var=\"col\" value=\"0\"}
		{/if}
		<td>{$data[element]}
		</td> {assign var=\"col\" value=\"`$col+1`\"}
	{/section}
	{assign var=\"remainder\" value=\"`$numCols-$col`\"}
	{section name=emptyElement loop=$remainder}
		<td>&nbsp;</td>
	{/section}
	</tr>
</table>

NumCols is the number of columns you want, in the example is “6″, then when the column to be transformed into 7 new row. Hopefully this is useful for you. Happy coding.

Lack iPad As New From Apple Products (Review For Minus Values)

January 29th, 2010 Admin No comments

Apple has released a new product into the current warm conversation in the field of gadgets and technology. They called iPad new products. This product is said to be the best way to use email, web, or organize photographs. They unite Safari, iTunes, iPods, iBooks, and the App Store in this iPad.

Lack iPad As New From Apple Products (Review For Minus Values)

Lack iPad As New From Apple Products (Review For Minus Values)

But whether it iPad has been perfect and has no shortage at all? Even some analysts say that technology has not iPad proper focus. As netbook competitors? as a competitor smartphone? or just the gadget as a substitute for reading material? Here are a few shortcomings iPad.
Read more…