Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with image placement

Status
Not open for further replies.

ssmossr

Technical User
Jan 20, 2008
3
US
Hello,
I'm using a web template that contains some .js files. I've figured out how to everything I need to except...

in the header.js; I've got my logo and I've got the shop now button the client wants...however, that shop now button needs to be further to the right, centered over the pictures in the right column. I figured I just needed to add spaces, however when I did that the html code for the spaces showed up in the header.

A page to view the header is:


The info from the header.js file is:

document.write('<TABLE cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor="'+color+'">');
document.write('<tr><td align="left" class="printhide">');
document.write('<a href="home.htm"><IMG SRC="picts/logo.jpg" border="0"></a>');
document.write('<a href="webstore.htm"><img src="picts/shop.jpg" border="0"></a><br>');


if (headerline == "yes") {
document.write('</td></tr><tr><td bgcolor="#'+linecolor+'" height="1">');
document.write('<IMG SRC="picts/spacer.gif" HEIGHT="1" WIDTH="50" border="0"><br>');
}
document.write('</td></tr></table>');

If any of you can tell me how on earth to get that shop now button over to where it needs to be I would be forever in your debt!

Thanks in advance,
Sharon
 
Use two table cells, set a width on the second one equal to the width of the right-hand column. The first should expand to take up the remainder of the width.

Alternately you could do a nice layout that uses CSS instead of tables, which would ultimately provide better results for your customer (and theirs more importantly). But using two table cells will get you out of this particular pickle.

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.

Webflo
 
Hi thanks for the response...however the template uses .js and css where the header is available to me only with the .js file.

Are you saying that I can add a table within the .js file?

Thanks again,
Sharon
 
This is not an appropriate use for Javascript. I think I understand what you're trying to do, but you'd be much better off using server-side includes or server-side scripting (ASP or PHP).

You also could benefit from dropping the tables for layout and using <div>s instead, something like:

Code:
<div style="width:100%; background:#888800;" class="printhide">
  <div style="float:left; width:80%">
    <a href="home.htm"><IMG SRC="picts/logo.jpg" border="0"></a>
  </div>
  <div style="padding-top:20px;float:right;padding-right:20px;">
    <a href="webstore.htm"><img src="picts/shop.jpg" border="0"></a>
  </div>
</div>

Using this method, you can get exact placement on the page, or set things up for relative positioning.

Lee
 
Thank you Lee! I'll see if I can play with it and get it to work!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top