Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    Oregon
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Trying to get this centered - will not

    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 ). 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 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.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Try this
    PHP Code:
    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{$keyeq '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";



  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •