title: HTML align text left and right on same line
body: <p>I am hoping to find a better way to do this, but right now, for necessary reasons, I have a perl script that prints out html code. One of the subs uses a for loop to iterate through a directory and print out the name of the file with the last modified date:</p>
  
  <pre><code>  foreach my $result (@files) {
      if ($result =~ /\.txt/ ) {
        chomp $result;
        my $filename = basename($result);
        my $time = (stat("$result"))-&gt;[9] or die "$!";
        my $date = localtime $time;
        my $filestat = '&lt;div style="text-align:left;"&gt;' . "$filename" . '&lt;/div&gt;&lt;div style="text-align:right;"&gt;' . "$date" . '&lt;/div&gt;';
        push(@final_result,$filestat);
      }
    }
    my $final_result_stat = join('&lt;br&gt;',@final_result);
    my $header = '&lt;p style="text-align:left;"&gt;File Name&lt;span style="float:right;"&gt;Last Modified Date&lt;/span&gt;&lt;/p&gt;';
    return "$header" . "$final_result_stat";
  }
  </code></pre>
  
  <p>The resulting html output is put in between  tags and placed in a table in the body. The issue I am having is the text output (the $filename and $date) are not aligned on the same line. They seem to be one line beneath each other but $filename is aligned left and $date is aligned right. Also, the next resulting output is quite far spaced and I would like them to be more condensed.</p>
  
  <pre><code>Current:
  
  Filename
                           Date
  
  Filename
                           Date
  
  I want:
  
  Filename            Date
  Filename            Date
  </code></pre>
  
  <p>Also, I know this is still in its rough stages, so any suggestions on how to make this cleaner and better are highly welcomed!</p>