finally i made the code work for me :) - thanks for inspiration - i own you
a code - hope you can do it easiest way - i am just begginer - so it's
likely the simplest way to achive the same result
the code was:

$sth->prepare(SELECT * FROM table);
$sth->execute;
$ref = $sth->fetchall_arrayref;

print table({-border=>1},
                        Tr({-align=>CENTER, -valign=>TOP},[
                                th(\@naglowek), #that's not so important
                                td({-bgcolor=>'yellow'},$$ref[0]), #couldn't
change text color here
                                td($$ref[1])
                        ])
                );

i rewrote it

$sth->prepare(SELECT * FROM table);
$sth->execute;
@1 = $sth->fetchrow_array;
$ref = $sth->fetchall_arrayref;

    foreach (@1) {
                        $_="<font color=green>".$_."</font>";
    }
print table({-border=>1},
                        Tr({-align=>CENTER, -valign=>TOP},[
                                th(\@naglowek), #that's not so important
                                td(\@1), #now the text color is green :))
                                td($$ref[0])
                        ])
                );
maybe some sugestion not using fetchrow_array method
thanks
greg

Użytkownik Dave K <[EMAIL PROTECTED]> w wiadomości do grup dyskusyjnych
napisał:[EMAIL PROTECTED]
> Greg,
>  Show some code, if you can.
>
> > i am using references in
> > table rows - it's better for me to highlight row by bgcolor avoiding
> Why would references be a problem?
> > additional loops - but maybe any idea how to quick change text color for
a
> > row that's defined as reference to table - thanks in advance
> A function comes to mind:
>
> sub wrap_it {
>  $td = shift;
>  return "<font color='red'>".$td."</font>";
> }
> But if you can show some code, it might become apparent why another
approach
> is more attractive.
> David
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to