Re: [SMARTY] html_table frustration

From: Date: Wed, 12 Nov 2003 09:19:25 +0000
Subject: Re: [SMARTY] html_table frustration
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10526@lists.php.net to get a copy of this message
i think there was a bug in the docs/example some months ago. but that is fixed. the correct docs a online. a grep showed the french docs still have this bug. this'll be fixed soon. so it's attr not attrs everywhere. On Wed, Nov 12, 2003 at 09:13:57AM +0000, Raul Carvalho wrote: > > Hello! > > I am using 2.5.0 and I am having the same problem. The simplest example in > the documentation doesn't work. > > I think this might be a bug in the newer versions, but I'm not sure. > > This is my tested code: > > test.php > -------- > <?php > define ('SMARTY_DIR', '/apache2/shared/smarty/libs/'); > require (SMARTY_DIR.'Smarty.class.php'); > $smarty = new Smarty; > $smarty->template_dir = '/apache2/htdocs/templates/'; > $smarty->compile_dir = '/apache2/htdocs/templates_c/'; > > $smarty->assign('data', array(1,2,3,4,5,6,7,8,9,0)); > $smarty->display('test.tpl'); > ?> > > test.tpl > -------- > <html> > <head><title>html_table test</title></head> > <body> > {html_table loop=$data cols=4 table_attrs='bgcolor="red"'} > </body> > </html> > > This is the output to the browser: > ---------------------------------- > <html> > <head><title>html_table test</title></head> > <body> > <table border="1"> > <tr > > <td >1</td> > <td >2</td> > <td >3</td> > <td >4</td> > </tr> > <tr > > <td >5</td> > <td >6</td> > <td >7</td> > <td >8</td> > </tr> > <tr > > <td >9</td> > <td >0</td> > <td >&nbsp;</td> > <td >&nbsp;</td> > </tr> > </table> > > </body> > </html> > > One final note: is the blank line between </table> and </html> normal? And > the extra space character in <tr > and <td >? Seems a bit strange... OR > clumsy :-) > > Can someone check this up? > > Regards, > Raul > > > Hi all! > > > > U am sorry but I am really in the trouble. In the > > moment I am fighting very stiff deadline. First I made > > my application everything works fine now I am > > implementing style. My main problem is inability to > > pass attributes to the html_table function > > > > {html_table loop=$oglasitable table_attrs='border=\"0\" > > cellpadding=\"0\" cellspacing=\"0\"' > > td_atrrs='valign=\"top\"' } > > {* That does not work *} > > > > {html_table loop=$oglasitable table_attrs='border="0" > > cellpadding="0" cellspacing="0"' > > td_atrrs='valign="top"' } > > {* That does not work either *} > > > > I tried tutorial example with border="0" and didn't work. > > > > I use Smarty 2.6 RC2 > > > > Please help me ASAP. > > > > Thanks. > > > > P.S. I hope that I will not have to make another > > template and change all other templates that use > > html_table. > > > > -- > > Smarty General Mailing List (http://smarty.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > -- > Raul Carvalho > PRISMA, S.A. > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.smarty.general (#10526) next »