...

View Full Version : Trying to get this centered - will not



fmv503
07-05-2005, 12:43 AM
Hello Expert(s)!

I have tried putting center around the table in the code below) - simple it should be. Nothing I have tried works.

This is at the end of Matt's simple search script. You can see the entire script if you want to go here. ( http://www.scriptarchive.com/search.html (http://) ). I need to get the part that I copied below centered on the page with a border around it. I have tried everything and nothing has worked.

I have inserted the search inside my index page here: www.attincinc.com (http://) with the rest of the code (search.pl) in my cgi-bin. This is the part of the code that shows how the results page will look. I want everything centered on the page with a border. I have tried every which way and it doesn't center or show a border when I edit it.

Below is the original coding :

sub return_html {
print "Content-type: text/html\n\n";
print "<html>\n <head>\n <title>Search Results</title>\n </head>\n";
print "<body bgcolor=\"white\" link=\"black\" vlink=\"orange\">";
print "<table width=\"720\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
print "<tr><td><img src=\"/images/topgradient.jpg\"></td></tr>";
print "<tr><td><img src=\"/images/LogoHeader.jpg\"></td></tr>";
print "</table><font face=\"Verdana,Tahoma,Arial\">";
print "\n <center>\n <h1>Search Results</h1>\n </center>\n";
print "Below are the results of your Search:<p>\n";
print "<ul>\n";
foreach $key (keys %include) {
if ($include{$key} eq 'yes') {
print "<li><a href=\"$baseurl$key\">$titles{$key}</a>\n";
}
}
print "</ul>\n";
print "<a href=\"$title_url\">Back to $title</a>\n";
print "<table width=\"720\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
print "<tr><td><img border=\"0\" src=\"/images/bottomgradient.jpg\"></td></tr></table>";
print "</body>\n</html>\n";
}

If I can get it centered, it will make the whole site consistent. Any help would be greatly appreciated! Thank you.

_Aerospace_Eng_
07-05-2005, 02:41 AM
Try this


sub return_html {
print "Content-type: text/html\n\n";
print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"";
print "\"http://www.w3.org/TR/html4/loose.dtd\">";
print "<html>\n <head>\n <title>Search Results</title>\n </head>\n";
print "<body bgcolor=\"white\" link=\"black\" vlink=\"orange\">";
print "<table width=\"720\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin:auto;\">";
print "<tr><td><img src=\"/images/topgradient.jpg\"></td></tr>";
print "<tr><td><img src=\"/images/LogoHeader.jpg\"></td></tr>";
print "</table><font face=\"Verdana,Tahoma,Arial\">";
print "\n <center>\n <h1>Search Results</h1>\n </center>\n";
print "Below are the results of your Search:<p>\n";
print "<ul>\n";
foreach $key (keys %include) {
if ($include{$key} eq 'yes') {
print "<li><a href=\"$baseurl$key\">$titles{$key}</a>\n";
}
}
print "</ul>\n";
print "<a href=\"$title_url\">Back to $title</a>\n";
print "<table width=\"720\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
print "<tr><td><img border=\"0\" src=\"/images/bottomgradient.jpg\"></td></tr></table>";
print "</body>\n</html>\n";
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum