Stevan,
Sorry I haven't had time to reply. My work week has been especially busy and
I didn't have time to respond to you or to help answer any of the other
questions for the last few days.
Congratulations. You have the dubious honor of being the first Pub 2002 user
that has posted and said that the centering code we use for Pub 2000 webs,
didn't work for your Pub 2002 site. Another Pub 2002 user had told us
sometime in the past that it did work, but apparently it doesn't work all
the time.While neither Don or I have Pub 2002 installed and can't test and
verify this, I think we will have to change the boilerplate answer he and I
and Spike give for centering questions in the future. Thanks for the
feedback.
Given that I do not have Pub 2002 installed, I can't say for sure whether
your experience is unique to your web publication or more general. However,
I copied your source code for your home page, and manually edited the code
with NotePad, and wasn't able to get the Pub 2000 centering code to work
either. The good news is that I was able to get the centering code string we
use for Pub 2003 and 2007 to work. In fact, it appears from a couple quick
tests that it also works in Pub 2000 webs. Once again, I was only using your
source code and thus I didn't have the embedded images, and it is possible
that it won't work for you. However, I will share the code string that I
found worked, and you can test it yourself.
------------
</head><table border="0" cellpadding="0" cellspacing="2"
width="833"align="center"><tr><td>
------------
It worked in IE, FF, Opera, Safari, and Chrome. And since your clock image
is imported I was able to confirm that it was centered. The placeholders for
the other images that you embed all seemed to be in the proper place.
The reason I wanted to know how wide your pages are, is the code includes
the page width in pixels. If you don't use the pixel width of the page, the
page will not be perfectly centered in the browser window. It will be offset
somewhat. I approximated your home page at 833 pixels wide, or ~22 cm or
~8.7 inches.
You can either post the width of your pages, and I will use Pub 2003 or 2007
to calculate the pixel width, or you can probably calculate it yourself.
Publisher outputs the html web pages at 96 ppi, so for example, if your
publication page is set up as a 7.5 inch page, you will get a 720 pixel wide
web page (96 X 7.5). If you are using centimeters, the conversion may not be
so exact, so feel free to post that number and I will use Publisher to
calculate the pixel width.
You can test this code string yourself. If you aren't doing so already,
publish your webfiles to a folder somewhere on your local computer where you
can easily find them. Now go to that folder and find the index.htm file >
right click > open with > NotePad. Or just double click the index.htm file
which will open it in your default browser > View >
Source. Then in NotePad go to Edit > Find and paste:
</head>
in 'Find what:' and it will take you to where </head> is located in the
source code. Now replace </head> with the code string:
</head><table border="0" cellpadding="0" cellspacing="2"
width="833"align="center"><tr><td>
Close NotePad and save the changes. Go back to the index.htm file, double
click and preview the page in your browser. It should be centered.
Assuming that this works for you on your home page, I suggest you test one
other page at this point. Your 'About Author' page:
http://www.timesaversforteachers.com/index_page0003.htm seems to be wider
than 833 pixels. While the code string seemed to work in the source code for
the page, the large images were embedded in your publication and so I could
only see the placeholders in the test I did. If this page is wider than 833
pixels, you might find that the page is not perfectly centered. You might
have to change the layout such that it all fits on your standard size page
in order to get a perfect centering, or you may find it close enough. Once
again, not having your actual publication, or Pub 2002 installed makes it
impossible for me to say for sure.
I obviously didn't take the time to test each of your pages. And while you
may need to adjust the layout of some pages in order to get 'perfect'
results, I think you should get generally good results once you change the
width in the code string to the standard pixel width of your publication
pages.
Now as you just discovered, manually editing the source code of each page of
a Publisher web is neither desirable or practical. Publisher is designed
such that if you want to make any changes in your web pages, you must go to
the original Publisher publication, make your changes and then produce new
web files and upload those to your host. It simply isn't practical to
manually edit the html code in one page let alone 80 pages as in your case,
each time you want to update your website. So even though the 'proper' code
for centering a Publisher 2000 web page has been known for many years, it
was rarely used. Publisher users simply did not want to have to manually
edit each page of their site every time they updated. However the centering
question kept coming up and members of this group kept looking for an easy
and practical way to center Publisher pages.
The breakthrough came when someone, and that may have been either Don or
Spike, came across a free, little utility called "ReplaceInFiles" which you
can find at
http://www.emurasoft.com . This little program made it possible
to replace one line of code with another line of code in all the Publisher
2000 .html files 'automagically'. You did not need to open each .html file
and edit the code manually. Initially we ran the utility twice to replace
both the <head> and then the </head> tags with the 'proper' code. Then
through trial and terror it was discovered that it wasn't necessary to
replace the <head> tag...that replacing the </head> tag with '</head>
<center>' was all that was necessary to get Publisher 2000 web pages to
center in browser windows. Those of us that used Pub 2000 found that after
we set up ReplaceInFiles the first time that from that point on it required
only two clicks to automagically edit the new html code we produced each
time we wanted to update our sites. Click once to open ReplaceInFiles and
once to click the 'Replace All' button and the web files were ready to be
uploaded to the host. Woohoo! We had an easy, practical way to center our
pages, and quite honestly we didn't care that we were not using 'proper'
coding techniques or syntax...we were just glad that it worked.
However, the centering code we used for Pub 2000 pages didn't seem to work
for the newer versions of Publisher as the html coding engines had been
changed and produced different code. Time passed and an unknown Pub 2002
user told us that the code we used for Pub 2000 worked for them, so we added
that to our boilerplate answer. Intermittently someone would suggest some
code for Pub 2003 and 2007 but it either didn't work, or it couldn't be
reduced to one line of code which was necessary to use ReplaceInFiles.
Finally a person named Jo posted some code that did work in Pub 2003 and
2007 but it was again multiple lines of code and again required that both
the <head> and the </head> tag be edited in two steps. Then once again
through trial and terror we discovered that we didn't need to use all the
code she posted, and that we could combine most of the code into one line,
and replace just the </head> tag and that is how we came to use the current
centering code posted in the boilerplate. And once again, we didn't care
that the code was not 'proper'...just that it worked and was a practical,
easy way to center Pub 2003 and 2007 pages.
Our methods of centering Publisher 2000, 2003 and 2007 web pages do not use
'proper' code, but thus far no one has found this code to not work in any
Publisher web or in any browser. Until you, no one had told us that it
didn't work for Pub 2002, but it appears that the Pub 2003 and 2007
centering code does work in Pub 2002. You can test the code string I
provided and if it works, then use ReplaceInFiles to easily and
automagically edit your code so that your web pages will be centered...or go
a different route. Your choice...
You can save time and skip the manual test I proposed if you want, and just
test the code using 'ReplaceInFiles'. If you do, you can follow the basic
instructions that Don gave with a couple differences. I will paste a
modified version of his instructions below with some additional instructions
for you and for Pub 2003 and 2007 users.
-----------------
The four boxes in 'ReplaceInFiles' require the following information:
Find: </head>
Replace with: </head><table border="0" cellpadding="0" cellspacing="2"
width="833"align="center"><tr><td>
(Note that the code string will wrap in these instructions, and must be just
one line in this box. I use NotePad to prepare the code string and then just
copy and paste it.)
File Types: *.htm
(Note that Pub 2000 produces *.html files by default. You are using *.htm
files and that is also the default for Pub 2003 and 2007.)
In Folder:
(Use the ... button to browse to the folder where the Publisher *.htm files
are located on your hard drive.)
The bottom four boxes can be left blank for Pub 2000, but if you are using
the 'organizing folder' option in Pub 2003 and 2007. You should check
'Replace in Subfolders' so the *.htm files in that 'organizing folder' (the
'index_files' folder) will also be edited.
Once the boxes are filled out and the "Replace all" button is selected, the
entries are retained for the next time you use the program. This also means
that you should choose a permanent folder location on your hard drive to
direct your web files to each time you publish new web files from Publisher.
Then it is a matter of opening 'ReplaceInFiles' and clicking the "Replace
all" button and your web files are ready to be uploaded to your host.
--------------
So there you go. A long winded suggestion for a method of centering your Pub
2002 web pages. As you found some of the other recent posts useful,
interesting and amusing I decided you might appreciate the historical
perspective of how the centering workaround evolved. If you decide to try it
please post back and let us know if it worked for you. I would like to test
your pages in the different browsers to confirm that there is no problem
there, and if it all works as expected we will change our boilerplate
instructions accordingly. Thanks for letting us know that the centering code
did not work for your Pub 2002 pages, and contributing to the evolution of
our centering code solution. Hopefully in the next version of Publisher MSFT
will build-in the option of centering pages, and the arguments about these
workarounds and how 'proper' they are will become moot.
DavidF