Solved

Getting a footer on each page

Posted on 2003-11-20
9
274 Views
Last Modified: 2010-04-09
Hi All,

Well I am using the OnRequestEnd.cfm file available in cold fusion that is automatically inserted at the end of each page to attempt to have a little copyright blurb at the bottom of each page.

I have a couple of queries as regards this...

First here is the code I want to insert at the bottom of each page

<TABLE WIDTH="100%" ALIGN="CENTER" BORDER="0" CELLSPACING="0" CELLPADDING="0">
  <TR>
    <TD BGCOLOR="#0066FF" WIDTH="100%"><IMG SRC="assets/spacer.gif" BORDER="0" HEIGHT="1" WIDTH="1"></TD>
  </TR>
  <TR>
    <TD ALIGN="CENTER"><FONT COLOR="#003399" SIZE="1">Website design by <A HREF="mailto:brad">Brad</A>, 2003</FONT></TD>
  </TR>
</TABLE>

I am having a problem with this code appearing to the RIGHT of the page's contents rather than down below it!! This only happens on some pages though and not on others. The pages it does happen on are fairly simple and do not have unclosed tables etc on them.

Secondly, i was wondering if there is a way so that it appears at the very bottom of the screen instead of directly under the content (as this can look a bit funny when the page is only as high as half a page). It could either *Stay* at the bottom of the screen or better would be directly under the page if there is a scroll bar AND at the bottom of the screen if there is no scroll bar.

Thanks for reading this far!

Cheers,
Brad
0
Comment
Question by:bradderick
9 Comments
 
LVL 11

Accepted Solution

by:
Zontar earned 500 total points
ID: 9795038
> I am having a problem with this code appearing to the RIGHT of the page's contents rather than down below it!
Try inserting a <br clear="all"> just before the opening <table> tag.

> Secondly, i was wondering if there is a way so that it appears at the very bottom of the screen instead of directly under the content (as this can look a bit funny when the page is only as high as half a page).

That's the problem. If the document isn't long enough to take up all of the space in the browser window, then it's not long enough. About the only wasy around this is either to insert empty paragraphs or use a fixed-height table (or possibly some other container of fixed height) to encliose the whole layout. Problem then is that you end up with lots of empty space.

Or you could try some CSS: Add id="footer" to your table tag and #footer {position:absolute; bottom:5px;} add see what happens.
0
 
LVL 11

Expert Comment

by:Zontar
ID: 9795062
(For those of you playing along at home: yes, "bottom" IS a valid CSS positioning attribute. So is "right".)

Oh... there's a bug in some browsers, I forget which ones... wrap your table in a DIV and apply the positioning to that instead:

<style type="text/css">
  #footer  {position:absolute; bottom:5px; }
</style>


<div id="footer">
  <table>
... etc.
  </table>
</div>

That should do the job.
0
 
LVL 6

Expert Comment

by:jarasa
ID: 9796434
Hi.

You can always use a FRAME and put your copyright there, then you'll see it always at the bottoom of the browser even if the scrollbar appears.

<frameset rows="*,30" cols="100%" frameborder=0 framespacing=0>
      <FRAME NAME="Body" scrolling="no" frameborder=0 framespacing=0 marginwidth=0 marginheight=0 noresize="true" src="your_page.html">
      <frame name="Copyright" scrolling="no" frameborder=0 framespacing=0 marginwidth=0 marginheight=0 noresize="true" src="copyright.html">
      <noframes>
            No frames supported.
      </noframes>
</frameset>

Regards
Javier
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 31

Expert Comment

by:GwynforWeb
ID: 9801986
Use he style sheets , this works
<head>
<style>
<!--
body   { padding: 0px; margin: 0px; }
div.footer { position: absolute; bottom: 0px; }
//-->
</style>
</head>
<body>
<center>HELLO WORLD</center>
<div class="footer">
<TABLE WIDTH="100%"  ALIGN="CENTER" BORDER="0" CELLSPACING="0" CELLPADDING="0">
  <TR>
    <TD WIDTH="100%" ></TD>
  </TR>
  <TR>
    <TD BGCOLOR="#0066FF" WIDTH="100%"><IMG SRC="assets/spacer.gif" BORDER="0" HEIGHT="1" WIDTH="1"></TD>
  </TR>
  <TR>
    <TD ALIGN="CENTER"><FONT COLOR="#003399" SIZE="1">Website design by <A HREF="mailto:brad">Brad</A>, 2003</FONT></TD>
  </TR>
</TABLE>
<p>
</div>
</body>





0
 
LVL 31

Expert Comment

by:GwynforWeb
ID: 9801991
works fine with span instead of div as well
0
 
LVL 11

Expert Comment

by:Zontar
ID: 9802092
>  works fine with span instead of div as well

But it wouldn't validate, as span's content-model is inline and div's is flow. span can't contain block elements.

Besides, I suggested using "bottom" first. <G>
0
 
LVL 31

Expert Comment

by:GwynforWeb
ID: 9802846
Zontar,
    Sorry some how I missed you first post. Span works fine for the suggested footer by bradderick, and I could not get any block elements to cause problems with it either.
0
 

Author Comment

by:bradderick
ID: 10800842
Thought this was accepted ages ago. My apologies Zontar for the extremely long wait for points!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question