in reply to How to implement CSS in perl script.

First you need to print (X)HTML (or XML) not plain text.

Second you need to print correct HTTP header (to tell client browser what type of document you send).

Third if you need CSS (do you mean stylesheet?) use stylesheet as your document type demand. So you may use <link ... /> tag or <style ...>...</style> for (X)HTML or maybe XSLT for XML...

  • Comment on Re: How to implement CSS in perl script.

Replies are listed 'Best First'.
Re^2: How to implement CSS in perl script.
by aalneyperl (Acolyte) on Nov 30, 2007 at 14:19 UTC
    Hi Gangabass, I need to print the output in a simple HTML format..for example using cascading stylsheet i want to create a table with the variable names on the left coulum and there values on the right with some suggestion. Thanks.

      Maybe you need something like this:

      print "<table><thead><tr><th>Slave_IO_State</th><th>Master_host</th><t +h>Slave_IO_Running</th><th>Slave_SQL_Running</th></tr></thead><tbody> +"; while ( my @val = $mas_hos->fetchrow_array() ) { print "<tr><td>$val[0]</td>"; print "<td>$val[1]</td>"; print "<td>$val[10]</td>"; print "<td>$val[11]</td>"; #print "<td>$val[33]</td>"; print "</tr>\n" } print "</tbody></table>\n";