coldfingertips has asked for the wisdom of the Perl Monks concerning the following question:

I am having problems getting this table to work. I am trying to get the H5() to actually do something with the text but instead it's printing to screen as text rather than acting like code. When I remove the quotes around h5('hi')"), it changes the text but it alters the table cell. Can anyone tell me what's wrong with this?
print table( Tr( td({-height=>'10', width=>'700', bgcolor=>'#BBCCEE'},"h5('hi)" +), ), Tr( td({-height=>'10', width=>'700', bgcolor=>'#BBCCEE'},""), ), );

Replies are listed 'Best First'.
Re: CGI tables *runs*
by particle (Vicar) on Jun 24, 2003 at 17:17 UTC

    you've got some really funky quotes there. try:

    td({-height=>'10', width=>'700', bgcolor=>'#BBCCEE'}, h5('hi') ),

    ~Particle *accelerates*

      One thing which has helped me when working with tables in CGI is start_table and end_table. This might have helped you pick up the problem with quotes which particle has pointed out.

      use CGI qw(:standard start_table end_table); print start_table; print Tr(td({-height=>'10', width=>'700', bgcolor=>'#BBCCEE'},h5('hi') +)); print Tr(td({-height=>'10', width=>'700', bgcolor=>'#BBCCEE'},"")); print end_table;
        Nope, that wasn't the problem. When I remove the quotes the text changes but the table get's shifted as well, it makes the TD twice the size when the h5 works.