Hi, your code looks good. Its working fine for me with hyperlink. In DBIx::XHTML_Table module, all the column names are in same case (lower or upper) as of database field name.

Look the code:

use DBIx::XHTML_Table; # database credentials - fill in the blanks my ($data_source,$usr,$pass) = (); my $table = DBIx::XHTML_Table->new('DBI:mysql:project', '', ''); $table->exec_query("select * from test"); $table->modify(table => { width => '100%', cellspacing=> '2', cellpadding=>'5', 'border-style' => 'inset', 'border-width' => 'thin', }); $table->modify(th => { style => { color => '#FFFAF0', background => '#4682B4', 'text-align' => 'center', 'text-transform'=> 'uppercase', } },'head'); $table->modify(tr => { style => { background => ['#B0C4DE','#F0F8FF'], } }); $table->modify(td => { style => { 'text-align' => 'left', 'white-space' => 'nowrap', } }); $table->modify(td => { style => { 'text-align' => 'center', 'white-space' => 'nowrap', } },['id']); $table->modify(th => { style => 'background: #FFF0F5' },'id'); $table->map_cell( sub{ my $datum = shift; return qq|<a href="http://sctesrv.india/cgi/project/viewpro +jectdetail.cgi?projectid=P-$datum">"$datum"</a>|; }, ['id']); print $table->output;
Output as: <table width="100%" cellspacing="2" cellpadding="5" border-width="thin +" border-style="inset"> <thead> <tr style="background: #B0C4DE;"> <th style="background: #FFF0F5">Id</th> <th style="text-align: center; text-transform: uppercase; colo +r: #FFFAF0; background: #4682B4;">Value</th> </tr> </thead> <tbody> <tr style="background: #F0F8FF;"> <td style="text-align: center; white-space: nowrap;"><a href=" +http://sctesrv.india/cgi/project/viewprojectdetail.cgi?projectid=P-1" +>"1"</a></td> <td style="text-align: left; white-space: nowrap;">hello</td> </tr> <tr style="background: #B0C4DE;"> <td style="text-align: center; white-space: nowrap;"><a href=" +http://sctesrv.india/cgi/project/viewprojectdetail.cgi?projectid=P-2" +>"2"</a></td> <td style="text-align: left; white-space: nowrap;">googbye</td +> </tr> <tr style="background: #F0F8FF;"> <td style="text-align: center; white-space: nowrap;"><a href=" +http://sctesrv.india/cgi/project/viewprojectdetail.cgi?projectid=P-3" +>"3"</a></td> <td style="text-align: left; white-space: nowrap;">friend</td> </tr> </tbody> </table>

Regards,
Velusamy R.


eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';


In reply to Re: DBIx_XHTML_Table usage - Urgent Please by Samy_rio
in thread DBIx_XHTML_Table usage - Urgent Please by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.