# Insert an Image into a Page Header



## pepsi71ocean (Apr 1, 2008)

Is there a way to insert a logo into the page header, or so it will print out at the top of every page when printed?


For example, im writing out a form that is multiple pages long. Is there a java script or a html code that will print the company logo at the top of every new page when its going to be printed. I don't want to have to insert the image into the document in random places pending where the document will print.

any help would be appreciated.


----------



## pepsi71ocean (Apr 1, 2008)

Where can you do that in Microsoft Expression? Every time ive tried, Internet Explorer just keeps kicking it off the page, its strange.


----------



## Kreij (Apr 1, 2008)

Well, if you are dynamically creating the page, you can put something in the body that will accomplish this.

For example ...

```
<html>
<head>
    <header stuff>My headerstuff</header stuff>
</head>
<body>
    <img src="logo.gif" alt="My Cool Company"></img>
    <div id="dynamic" name="dynamic">
    </div>
</body>
```

You can then write code to insert you dynamic information into the innerHtml portion of the <Div> tag.  The <img> tag will be in the page every time.

There are, of course, other ways. But this is a simple example.


----------



## W1zzard (Apr 1, 2008)

Kreij said:


> Well, if you are dynamically creating the page, you can put something in the body that will accomplish this.
> 
> For example ...
> 
> ...



uh .. are you sure this works to show the logo on every single printed page?


----------



## Kreij (Apr 1, 2008)

W1zzard said:


> uh .. are you sure this works to show the logo on every single printed page?



Oops ... my bad. Misinterpreted the post. I was thinking he wanted the logo every time you did a print job. Sorry.
Be back with answer after I can test a few things (If no one beats me to it).


----------



## Kreij (Apr 1, 2008)

If you want to do this in html & CSS it will take a bit of fiddling to get everything to look correct. The only way I can figure how to accopmlish this is to user CSS styles to manipulate html tables.


```
<style type="css/text" media="print,screen" >
th {
    // table header column attributes
}

thead {
    display:table-header-group;
}

tbody {
    display:table-row-group;
}
</style>

<table>
    <thead>
        <tr>
            <th><img src="Logo.jpg"></img></th>
        </tr>
    </thead>
    <tbody>
        <tr>
           // Dynamically insert form data between <td></td> tags, one row at a time.
        </tr>
    </tbody>
</table>
```

You will want to make the table large enough that it fills the area within the page's margins.
When you run it, it should place the contents of the table's header (your logo or whatever) whenever a page break occurs.

Please note that if make a row of data contain somthing that is larger than a page, this whole thing will break.

It's not pretty but you should be able to get it to work.

You could also do something like send the data into a MS word template which contains the logo in its header. That, however, would require anyone who want to print it to have MS Word, a Word viewer, or a Word browser plug-in.

Be aware, however, that you want to do any alignment in your CSS styles (as opposed to using HTML built-in syle attributes, as all of the HTML style atributes are being removed in HTML 5.0 in favor of using CSS formatting.


----------



## pepsi71ocean (Apr 2, 2008)

That goes into the webpage or a style sheet.

I have another question.  Is there a way to save a page with the information that is already entered into it. I'm using text boxes for example   

< input name="Text4" type="text" style="width: 163px" / >

And so is there a way to save the information that is entered into that text box. Whenever i try to save the page it saves the page but it saves the blank page, without the text that was imputed.

EDIT: I also need to figure out how to include a decent login page. i built a login page but whenever i try to log onto the secure area of the site i won't let me do it on the login page, but instead it will force me to sign on with the separate password prompt box.


----------



## Kreij (Apr 2, 2008)

Okay, this gets a bit more complicated.
Are you trying to save the information to pass it to another page, or are you trying to save the information to last the entire session that the user is doing, or are you trying to save the information for future sessions?


----------



## pepsi71ocean (Apr 2, 2008)

Kreij said:


> Okay, this gets a bit more complicated.
> Are you trying to save the information to pass it to another page, or are you trying to save the information to last the entire session that the user is doing, or are you trying to save the information for future sessions?




My dad says that it needs to save it so you can then send it by efax. So far whenever i try to save it empties out the fields and the choices as well.


----------



## Kreij (Apr 2, 2008)

What type of file format does it have to be so you can e-fax it?
(ie. .doc, .pdf .... etc.)

I have the feeling this won't be very simple to do.


----------



## pepsi71ocean (Apr 7, 2008)

.pdf, preferably, sorry for the late reply. But there was a breath of fresh air back into Access, but that didn't last.


EDIT: you said something about sending it to MS Word, how can that be done? If it can be sent into Word then i'de rather it be in .doc format.


----------

