Hello, I am writing a CGI script that will process form data, and it should print the name of the input, along with its value, in a table. When I have one or more values with the same name, the name should span rows to accommodate all values that correspond to that name. For example, if I have a name "color" with its values at "red", "green", "blue", then color should span 3 rows in my table. My question is, how would i change the rowspan attribute in my script to accommodate this:
#!/usr/bin/perl --
use strict;
use CGI;
print <<HTTP;
Status: 200 OK
Content-Type: text/html
HTTP
print <<HTML; 
<html>
    <head>
        <title>Parameters<title>
    <head>
    <body>
     <table border="1" cellpadding="5" cellspacing="1">
     <tr>
     <th>Name</th>
     <th>Value</th>
     </tr>
HTML
 my $query = new CGI;
 my($name, $value);
 foreach $name ( $query->param)
 {
    print "<tr>";
    print "<td>$name</td>";
    foreach $value($query->param($name))
    {
        print "<td>$value</td>";
        print "</tr>";
    }
}