Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with the code for a Box


ChrisJChrisJ

Recommended Posts

I have the following code for a box. The box looks fine, when i view it. When I put text in the box, highlighted below, after <center> below, the box doesn't completly enclose the text. In fact it only surrounds the word 'home' on three sides, left, top and bottom. Can somone help me modify this so that all of the text, between <center> and </center> below, will fit in the box and be completely enclosed by the box borders? Thank you.

 

<!-- start of grey box -->

<table border="0"cellpadding="5" cellspacing="0" width="100%">

<tr>

<td>

<table border="0"cellpadding="0" cellspacing="0" width="100%">

<tr>

<td colspan="3" style="background: #bbc3d3;"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></td>

</tr>

<tr>

<td style="background: #bbc3d3;" width="1"><?php echo tep_draw_separator('pixel_trans.gif', '1', '100%'); ?></td>

<td class="main">

<center>

<td width="10%"><a href=""> <font face="arial"> home</td><td><a href=""><font face="arial">how does it work</td><td><a href=""><font face="arial">contact us</td><td><a href=""><font face="arial">faq</td> <td> <a href=""><font face="arial">promote</td><td> <a href=""><font face="arial">sign-up</td><td> <a href=""><font face="arial">log-in</td>

</center>

</td>

<td style="background: #bbc3d3;" width="1"><?php echo tep_draw_separator('pixel_trans.gif', '1', '100%'); ?></td>

</tr>

<tr>

<td colspan="3" style="background: #bbc3d3;"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></td>

</tr>

</table>

</td>

</tr>

</table>

<!-- end of grey box -->

Link to comment
Share on other sites

<td class="main">

      <center>

            <td width="10%"><a href=""> <font face="arial"> home</td><td><a href=""><font face="arial">how does it work</td><td><a href=""><font face="arial">contact us</td><td><a href=""><font face="arial">faq</td> <td> <a href=""><font face="arial">promote</td><td> <a href=""><font face="arial">sign-up</td><td> <a href=""><font face="arial">log-in</td>

      </center>

          </td>

 

Problems I can see here...

 

You've opened a td, then opened another td within it. This is going to cause problems. You've also got too many tags written seperately that could be combined, or covered by a style.

 

I take it you are trying to get a horizontal row of links? Decide whether you really need each word to be in it's own <td> (I think text formatting alone will suffice). If you do need everything in <td>'s, you need a <tr> between the first <td> and the second one. Be prepared to use colspan commands in tables elswhere in the page to stop the <td> being drawn incorrectly.

 

I would also drop the <center> tag in favour of align="center" in a <td> tag.

- osCommerce is fun! -
Link to comment
Share on other sites

Problems I can see here...

 

You've opened a td, then opened another td within it. This is going to cause problems. You've also got too many tags written seperately that could be combined, or covered by a style.

 

I take it you are trying to get a horizontal row of links? Decide whether you really need each word to be in it's own <td> (I think text formatting alone will suffice).  If you do need everything in <td>'s, you need a <tr> between the first <td> and the second one. Be prepared to use colspan commands in tables elswhere in the page to stop the <td> being drawn incorrectly.

 

I would also drop the <center> tag in favour of align="center" in a <td> tag.

 

Thank you. Yes I am trying to get a horizontal row of links, inside a box. Could you show how you'd write this simpler? Or, you told me where to put the <td>, where do I put the </td>? Additionally, you spoke of colspan commands, i am not familar with alot of php, so i don't know about colspan commands. i'm learning as I go here. Any help would be greatly appreciated.

Link to comment
Share on other sites

For purely text (which is how I'd do it) I'd start with something like...

 

<td class="main" align="center"><a href="">home</a> <a href="">how does it work</a> <a href="">contact us</a> <a href="">faq</a> <a href="">promote>/a><a href="">sign-up</a> <a href="">log-in</a></td>

 

This will give a row of words that are links, styled like the "main" text style, aligned centrally, and each has a non-breaking space between them. Obviously, you need to fill in the hrefs with web links.

 

You probably need to open a <tr> and close with a </tr> above and below this.

- osCommerce is fun! -
Link to comment
Share on other sites

For purely text (which is how I'd do it) I'd start with something like...

 

<td class="main" align="center"><a href="">home</a> <a href="">how does it work</a> <a href="">contact us</a> <a href="">faq</a> <a href="">promote>/a><a href="">sign-up</a> <a href="">log-in</a></td>

 

This will give a row of words that are links, styled like the "main" text style, aligned centrally, and each has a non-breaking space between them. Obviously, you need to fill in the hrefs with web links.

 

You probably need to open a <tr> and close with a </tr> above and below this.

 

Thank you. Your code worked pretty well. I copied what shows up and as you can see it's almost perfect except it has >/a> between promote and sign-up as you can see here:

home how does it work contact us faq promote>/a>sign-up log-in

 

Can you help me remedy that?

 

Also, can you tell me how I can put a simply symbol in between each word. In my web site I am using a dot, much like a period, but one that isn't on the bottom like this . but at the same height as this dash - Thanks very much. Your help is greatly appreciated.

Link to comment
Share on other sites

promote>/a><a href="">sign-up</a>

 

Should read promote</a><a href=""">sign-up</a>

 

 

And actually, this is not PHP.

This is HTML

 

Honestly? You would do well from a few simple searches for the really basic stuff.

 

Adding the dash or whatever symbol you want would go where the nbsp: is between where there are two listed.

That stands for a space.

You can edit it to whatever you want, though you will want to keep it clean.

Do a search for HTML though. That will give you the basics to get a small leg up on looking through the PHP files, cause you get an idea of how the code flows.

One of these days, I will actually understand what I just changed...

 

But reading the Manual DEFINATELY helps...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...