Results 1 to 7 of 7

Thread: Frames Inside a Table?

  1. #1
    Join Date
    Aug 2008
    Location
    Stone, Staffordshire, England
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Frames Inside a Table?

    Dear All

    I am creating a website using tables in HTML and have now discovered why I made my last site have the navigation on the index page and the index page only!

    As I have started to add files to the site I am realising that I am having to keep adding new entries into the navigation on every page!

    So the only way I can figure out of getting around this one is to use frames, whereby I use a frame to display a file called lets say: navigation.html

    As the layout of the website currently uses tables I would like to keep the tables and would like to know if there is a way of inserting a frame into a cell in a table? Without any additional scrollbars. Or if there is a way of embedding a HTML file in a cell of a table?

    I would be most appreciative of any help offered, as I really don't know how I am going to get around this one without making my whole site frame based which I don't want to do!

    Kindest Regards Edward

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    You can't use the frame tag. Use iframe instead.

    Though it might work well, note that frames are evil (in a number of ways).

    You might find to use PHP's include() useful.

    Hope that helps.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Aug 2008
    Location
    Stone, Staffordshire, England
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok thanks for your help. Is the "frames are evil" directed at frames and frames only or at iframes as well?

    If directed at frames only please can I send you the code for my site and ask you how I should use it?

    And if so what is the best solution compatibility wise?

    Regards Edward

  4. #4
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Quote Originally Posted by holmedwa04 View Post
    Ok thanks for your help. Is the "frames are evil" directed at frames and frames only or at iframes as well?
    It was addressed on using both frames and iframes.

    Quote Originally Posted by holmedwa04 View Post
    If directed at frames only please can I send you the code for my site and ask you how I should use it?
    Please use the public board, so that others can help and at the same time benefit from the board member's response.

    Quote Originally Posted by holmedwa04 View Post
    And if so what is the best solution compatibility wise?
    ...don't use frames. Use either AJAX or server-side scripting to include file. PHP has one (include()).
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  5. #5
    Join Date
    Aug 2008
    Location
    Stone, Staffordshire, England
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok, I have tried the php thing and that just confuses the life out of me! I tried downloading Apache software and all sorts, I just couldn't get my head around how to use it.

    So I went for the iframes solution, really liking the results that I had achieved because it looked exactly like it did before and now I had just one page to change when I added a new page to my site.

    I couldn't have been more wrong! Obviously because it is a frame it opens in the same frame! So I nearly went mad when I clicked a link only to find it opening in the iframe! After calming down and looking into name and target attributes I have been able to set the name of a cell in my table to "main" and get the links in the navigation to target main.

    I was quite pleased with myself and thought I would tidy a few things up only to find that I have just completely messed everything up now! The navigation displays correctly and everything but as soon as I click a link on it, it opens in a new window as though the target is blank when it isn't it is quite clearly "main" which is one of the cells in the table!

    I would really appreciate any help! Because quite frankly at the moment I am ready to give up altogether!

    Kindest Regards

    Edward

  6. #6
    Join Date
    Aug 2008
    Location
    Stone, Staffordshire, England
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I have moved back to the php again and it produces the same results, it displays the page that you click for in the cell of the table that the link is in, not the main cell in the table.

    Is what I am trying to do impossible? Or should I just face the fact that when I make a new page I am going to have to edit every other page on my website?

    Again any help would be much appreciated.

    Kindest Regards

    Edward

  7. #7
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    I'd suggest trying Ajax. The Ajax Dynamic Content script works well and isn't to confusing.

    PHP and Apache would be a better way to go in the long run (more stable and more accessible), but it can be confusing if you try to do it yourself. Find out if your web host already supports PHP includes. If they do, then it's as simple as writing <?php include ('menu.html'); ?> wherever you want the menu.

    On a side note, you should look into learning how to format/ layout your webpages using css instead of tables. It might take a bit of experimenting to figure it all out, but it's worth it.

    [ edit ]: in regards to your iframe problem, try adding
    Code:
    target="_top"
    to all your menu links. I don't think a link can target a cell in a table; the "name" target is designed to target a specific frame.
    Last edited by traq; 10-29-2008 at 05:05 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •