Re: NEW centering thread

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



This 'solution' needs to come with an attached health warning.
A few minutes spent learning a little html coding should teach you that editing your web pages in the manner suggested will result in fundamentally invalid html documents containing a gross syntax error comprising of an incomplete statement in an invalid position. It could hardly be much worse. The fact that this appears to work relies upon the current versions of mainstream browsers being suitably flexible in rendering erroneous code. There is no guarantee they will be so accommodating in future versions, and it would be perfectly valid for a browser to simply display an error message or nothing on encountering such a page. Other browsers, such as those on handheld devices etc. are likely to give unpredictable results. Search engines may also fail to correctly parse or simply choose to ignore such pages. It also creates a very bad impression to technically savvy viewers of your pages.

There are of course much better ways to achieve the desired result in a correct and potentially less problematic manner. Utilising Google with the phrase 'center web page' is likely to return hundreds of references to descriptions - probably none resembling that usually proposed here, but many resembling that which follows:-
A simple (correct) method for Publisher 2007 pages:

Edit your .htm file(s) with any text editor.
Replace the phrase "<body style='margin:0'>" with "<body style='margin:0; text-align:center;'><div style='text-align:left; width:760px;'>"

(substitute the value "760px" (760 pixels) with a higher or lower value to suit your page width if required)

Further down the page. replace the phrase "</body>" with "</div></body>"

This method is obviously similar in complexity to do, but it can also be achieved easily on multiple files by using ReplaceInFiles, although there are better and more powerful programs available for that task. It can be applied to any web page but the initial <body> tag will vary from that above in pages from sources other than Pub 2007, so a small adjustment to suit will probably be needed.



"Spike" <zero_spam@xxxxxxxxxx> wrote in message news:%23RKwCeIaKHA.5544@xxxxxxxxxxxxxxxxxxxxxxx
==================================
Centering Publisher built Web Sites pages:
Version 2009-001
Added inch to pixel conversion
==================================

Edit the htm file(s) and replace </head> with

</head><table border="0" cellpadding="0" cellspacing="2" width="760"align="center"><tr><td>

" All above on one line "

Be sure that you edit the </head> line and NOT the <head> line

If you are using a page width different than 760 pixels change that number in the above line
If you are using inches for measurement multiply the width in inches by 96 and use that number

If you have multiple pages you might want to look at
http://www.emurasoft.com/replall/ a simple replace lines in multiple htm files


Setup the Replace in files program

Find: = </head>

Replace with: = </head><table border="0" cellpadding="0" cellspacing="2" width="760"align="center"><tr><td>

File Types: = *.htm or *.html (what ever one you are using)

In Folder: = Select the folder where you published the htm / html files

Check the Replace In Subfolders box

The settings will remain until you change them


Then after running the repalce in files program (Replace All) ftp the files to your server


Spike

.



Relevant Pages

  • Re: web layout
    ... If you have multiple pages you might want to look at ... http://www.emurasoft.com/replall/ a simple replace lines in multiple htm ... In Folder: = Select the folder where you published the htm / html files ... Then after running the repalce in files program ftp the files ...
    (microsoft.public.publisher.webdesign)
  • Re: searhes find htm and not html
    ... I used Google for the search and it gives you the links to the cached pages: ... And notice that the second hit for your site does reflect the .html file ... upload htm files but it doesn't let me use them. ... file extension, and that is cached. ...
    (microsoft.public.publisher.webdesign)
  • Having Some Browser Compatibility problems
    ... primary developement tool. ... I have found that the HTM page that is created in VISIO is NOT ... Create HTM versions of pages I have created in VISIO or other HTML ...
    (microsoft.public.visio)
  • Re: Security Startup Dialog
    ...  Do you mean a file with a .htm extension, ... to open db, just html. ... o.automationsecurity=1 ' set macro security LOW. ... Yes I mean a html or htm page. ...
    (comp.databases.ms-access)
  • RE: Unexpected behaviour of Listbox MultiSelect
    ... Dropdownlist/ListBox control, it should have encapsulated all the features ... like identifying multiple selection.... ... ListBox or DropDownList control just render them as html element, ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)