 |
HTML Help Please Search for the answer to your question before asking it! Thanks.
|
| 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....... |
|
|
| |
|
|
|
Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.19 © 2001, 2002 phpBB Group
|