HTML Help Forum Index HTML Help
Please Search for the answer to your question before asking it! Thanks.
 

HTML Table and Loop help needed
Post a Reply to this Topic Ask a New Question
Click here to go to the original topic
       HTML Help Forum Index -> HTML Form
View previous topic :: View next topic  
Author Message
manik



Joined: 14 Nov 2008
Posts: 3

Posted: Fri Nov 14, 2008 9:57 am     HTML Table and Loop help needed  

Hello,
I am trying to build a dynamic html table with the values captured from the command and here is my code:
print "<table border=1>";
print "<tr>";
print "<th>Pool Name</th>";
print "<th>Member</th>";
print "</tr>";
print "<tr>";

for my $pool ( sort keys %$data ) {
for my $ip_address ( sort keys %{ $data->{ $pool } } ) {
my @numbers = split /\./, $ip_address;
my $raw_ipaddr = pack("C4", @numbers);
$host = (gethostbyaddr($raw_ipaddr, 2))[0];
# printf "%-${POOL_NAME_WIDTH}s %${IP_ADDRESS_WIDTH}s\n\n",
# $pool,
# $host;
# print "<br>\n POOL Name:$pool , Members: $host<br>\n";

print "<td>$pool</td>";
print "<td>$host</td>";
} # for
} # for

print "</tr>";
print "</table>";


But the output is skewed i.e.
Pool Name Member
manik staff manik1 staff1

Rather than
Pool Name Member
manik staff
manik1 staff1

How to give a line break during loop?
manik



Joined: 14 Nov 2008
Posts: 3

Posted: Fri Nov 14, 2008 10:02 am     Fixed.  

Okay its working........Pl ignore.......
 
 
HOSTING / DESIGN
MAKE MONEY

       HTML Help Forum Index -> HTML Form
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.19 © 2001, 2002 phpBB Group