/    Sign up×
Community /Pin to ProfileBookmark

include html file in table

I am generating a table using javascript – see code below.

I want one of the cells to include a HTML file, that contains the body text of a letter. Is there a way for me to include that file’s contents in the code below.

this code is in a HTML file which I need to allow for editing on this data.

bev

var stringtest;
stringtest = (‘<center><table datasrc=”#myXML” width=”75%” border=”1″ ID=”Table1″>’);
stringtest = stringtest + (‘<tr align=center><td> <font size = ‘ + num + ‘ face=’ + face + ‘> <div datafld=name></div> </font></td></tr>’);
stringtest = stringtest + (‘<tr align=center><td> <font size = ‘ + num + ‘ face=’ + face + ‘> <div datafld=address></div> </font></td></tr>’);
stringtest = stringtest + (‘<tr align=center><td> <div class=page></div> </td></tr>’);
stringtest = stringtest + (‘</table></center>’);

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@Phil_KarrasAug 08.2003 — As far as I know there is no way to do that. Frames were developed to allow multiple HTML pages in one window, tables are an HTML thing & to my knowledge they were never intended to do this, & still do not support opening another HTML file within one of the table cells.

I know you can use: <img src='MyImage.jpg> inside a cell.

However, if there's an HTML was to show a page like that I've never seen it. Anyone else?
Copy linkTweet thisAlerts:
@pyroAug 08.2003 — You'd have to use a serverside language to include the file when it is called from the server, if you don't want to use an iframe...
Copy linkTweet thisAlerts:
@bsharrisauthorAug 08.2003 — I tried to include this, with the file existing on the root web directory, but nothing appeared.

so maybe it's my syntax or where I placed this.

from my example, can you place the syntax in there, and also if I have a basic html file, can I place this in the body? how will it know to run on the server side?

also, read somewhere that, you have to have SSI set up on a IPS, if I am running IIS, is there something I have to set


<!-- #include file="letter2.html" -->
Copy linkTweet thisAlerts:
@pyroAug 08.2003 — I don't know much about SSI, and even less about IIS. I personally use PHP for all my serverside needs. The SSI that you posted will include a file on servers that support them. You'll probably have to look up how you get SSI's to work on an IIS server. For the record, here's how you do an include in PHP:

[code=php]<?PHP
include ("file.htm");
?>[/code]
Copy linkTweet thisAlerts:
@bsharrisauthorAug 08.2003 — I know got my test to work, by changing the page to a shtml page, but when I try this test - putting the include in a table cell, using javascript - the letter3.txt content doesn't appear

anything obviously wrong?


var stringtest;

stringtest = ('<center><table datasrc="#myXML" width="75%" border="1" ID="Table1">');

stringtest = stringtest + ('<tr align=center><td> <font size = ' + num + ' face=' + face + '> <div datafld=name></div> </font></td></tr>');

stringtest = stringtest + ('<tr align=center><td> <font size = ' + num + ' face=' + face + '> <div datafld=address></div> </font></td></tr>');

stringtest = stringtest + ('<tr align=center><td><!-- #include file=letter3.txt --></td></tr>');

stringtest = stringtest + ('<tr align=center><td> <div class=page></div> </td></tr>');
Copy linkTweet thisAlerts:
@pyroAug 08.2003 — You don't have quotes around the filename... Maybe that's the problem.
Copy linkTweet thisAlerts:
@Jeff_MottAug 08.2003 — <!-- #include file="letter2.html" -->[/quote][size=2]&lt;!--#include virtual="/letter2.html" --&gt;[/size]This file would most likely be required to have a .shtml extension.if I am running IIS, is there something I have to set[/quote]Probably. However, I am not as familiar with IIS (Apache is the better, and more commonly used server). Though IIS should at least come with documentation. You can search for "SSI" or "Server Side Include" through that to see how to configure it.
Copy linkTweet thisAlerts:
@Alien_ManAug 08.2003 — if your interested in some java code I have some that may help you. It would require you to transfer the html file to a .txt file but would be easy to update if you haev the need to. This would consits of a servlet that would load the page and would call the .txt page in the place needed.

That is if your interest in Java code.
×

Success!

Help @bsharris spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...