
sleuth
Enthusiast
/ Moderator
Nov 12, 2000, 11:12 AM
Post #6 of 8
(999 views)
|
Ok, this code is really cool. <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> print qq~ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title></title> </head> <body> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" width="532" height="1"> ~; open(data, "<test.db"); while(<data> ){ ($number)=split(/\|/, $_); $c++; if ($c % 2){ print qq~ <tr> <td height="1" width="266"> <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">$number</font></b></td> ~; } if ($c % 2){}else{ print qq~ <td height="1" width="266"> <p align="center"><b><font size="2" face="Verdana" color="#FFFFFF"><i>$number</i></font></b></td> ~; } } close(data); print qq~ </tr> </table> </center> </div> </body> </html> ~; </pre><HR></BLOCKQUOTE> What it does is print the line of info in the <td tag but on every odd count, it prints a <tr>, that way it's able to print in the tables columns. It's a round about way, but I guess that's why perl is known for having more than one way of doing things. :) If you manage to swing this code into more columns, please let me know. No matter when. Sleuth
|