Table inside iFrame

S

Su Man

Hi,

Is it possible to have a table directly in iFrame ?
i.e. without using the html source in iFrame can I have table is iFrame
directly? How?

Please focus some light on this?

Thanks,
Su Man
 
B

Bernhard Sturm

Su said:
Hi,

Is it possible to have a table directly in iFrame ?
i.e. without using the html source in iFrame can I have table is iFrame
directly? How?

I don't understand your question. I mean, an iFrame is just like a
frame: an external html file, that will be shown in a defined frame
within the calling html... why shouldn't it be possible to have a table
within an iFrame? have you tried it? :) --

bernhard
 
S

SpaceGirl

Su Man said:
Hi,

Is it possible to have a table directly in iFrame ?
i.e. without using the html source in iFrame can I have table is iFrame
directly? How?

Please focus some light on this?

Thanks,
Su Man


I think you should be using layers rather than iframes. A layer can contain
any HTML elements and be placed anywhere on the screen, without having to
define a source.

Basically, you can't do what you're asking. Iframes can only contain
documents (such as asp, php, htm).
 
S

Su Man

I meant, I do not want to show an htm,jsp file inside a iframe.
Instead I directly want to construct a table inside iFrame.

Su Man
 
S

SpaceGirl

You cant do that... that's not what Iframes are for. Iframes are ONLY
designed for containing other pages. While those pages *could* be dynamic,
you simply cant "have a table inside it". You really need to pick up an HTML
book and look through how frames work, I think.

Su Man said:
I meant, I do not want to show an htm,jsp file inside a iframe.
Instead I directly want to construct a table inside iFrame.

Su Man
 
K

Kris

SpaceGirl said:
You cant do that... that's not what Iframes are for. Iframes are ONLY
designed for containing other pages. While those pages *could* be dynamic,
you simply cant "have a table inside it". You really need to pick up an HTML
book and look through how frames work, I think.

He/she wants a scrollable table.
 
W

Weyoun the Dancing Borg

SpaceGirl wrote:

Then s/he should place it in a layer, and enable content scrolling
(overflow) in it.

<div id="Layer1" style="position:absolute; width:350px; height:105px;
z-index:1; overflow: scroll;">the
wonderful thing about tiggers is that I'm the only one. the wonderful
thing
about tiggers is that I'm the only one. the wonderful thing about
tiggers is
that I'm the only one. the wonderful thing about tiggers is that I'm
the only
one. the wonderful thing about tiggers is that I'm the only one. the
wonderful
thing about tiggers is that I'm the only one. the wonderful thing
about tiggers
is that I'm the only one. the wonderful thing about tiggers is that
I'm the
only one. the wonderful thing about tiggers is that I'm the only one.
the wonderful
thing about tiggers is that I'm the only one. the wonderful thing
about tiggers
is that I'm the only one. the wonderful thing about tiggers is that
I'm the
only one. the wonderful thing about tiggers is that I'm the only one.
</div>
 
D

Dennis M. Marks

Su Man <[email protected]> said:
Hi,

Is it possible to have a table directly in iFrame ?
i.e. without using the html source in iFrame can I have table is iFrame
directly? How?

Please focus some light on this?

Thanks,
Su Man
If you will go to my site and look at money conversion you will see a
page with an iframe on the right. Initially it contains a web site for
obtaining the conversion factor. Later it contains a dynamicaly
generated table using the conversion factor. This is one way to do it
and layers may be better but I wrote it before knowing of a better way.
 
D

Dennis M. Marks

Dennis M. said:
If you will go to my site and look at money conversion you will see a
page with an iframe on the right. Initially it contains a web site for
obtaining the conversion factor. Later it contains a dynamicaly
generated table using the conversion factor. This is one way to do it
and layers may be better but I wrote it before knowing of a better way.

Oops. I just noticed that my server is down so it may take a little
time to see my site. Sorry. It is 2004-04-07 at 7:21 AM PDT.
 
D

David Dorward

Weyoun said:
<div id="Layer1" style="position:absolute; width:350px; height:105px;
z-index:1; overflow: scroll;">

I hate Dreamweaver[1]...

OK, "Layer1" is a very bad choice for an id, and an id isn't require here.

Elements shouldn't be absolutely positioned unless they need to be.

Left/Right and Top/Bottom appear to be missing

Sizes are generally better specified in a unit relative to the font rather
then an absolute unit.

So, the saner version of that code:

<div style="width: 45em; height: 10em; overflow: auto;">

- and an external style sheet is, as usual, preferred.

[1] More precisely, I hate the code it produces when not in the hands of an
expert who can work around its foibles and bad defaults (not that there can
be a good default value for an id).
 
M

mscir

Su said:
I directly want to construct a table inside iFrame.
<snip>

function buildiframetable() {
//I used a form with text boxes for table parameters
var tdpad = +document.forms("form1").tdpad.value
var tdspace = +document.forms("form1").tdspace .value
var tborder = +document.forms("form1").tborder .value
var rows = +document.forms("form1").rows .value
var cols = +document.forms("form1").cols .value

//I think NN wants name and id the same so getElementById works
var d = document.getElementById("iframe1").contentWindow.document

//build table
var table = d.createElement('table');
table.border = tborder;
table.cellPadding = tdpad;
table.cellSpacing = tdspace;
var tbody = d.createElement('tbody');
for (var i=0; i<rows; i++) {
var row = d.createElement('tr');
for (var j=0; j<cols; j++) {
var cell = d.createElement('td');
cell.appendChild(d.createTextNode(i + ', ' + j));
row.appendChild(cell);
}
tbody.appendChild(row);
}
table.appendChild(tbody);
d.body.appendChild(table)
}

code modified from a comp.lang.javascript post by Martin Honnen 04/07/04
 
W

Weyoun the Dancing Borg

David said:
Weyoun the Dancing Borg wrote:

<div id="Layer1" style="position:absolute; width:350px; height:105px;
z-index:1; overflow: scroll;">


I hate Dreamweaver[1]...
[2]





OK, "Layer1" is a very bad choice for an id, and an id isn't require here.

ok well make it a class then


Elements shouldn't be absolutely positioned unless they need to be.

easily fixed to percentages [2a]



Left/Right and Top/Bottom appear to be missing
yes





Sizes are generally better specified in a unit relative to the font rather
then an absolute unit.

well i didnt specify a font size?


So, the saner version of that code:

<div style="width: 45em; height: 10em; overflow: auto;">

- and an external style sheet is, as usual, preferred.

eee that's easier :)


[1] More precisely, I hate the code it produces when not in the hands of an
expert who can work around its foibles and bad defaults (not that there can
be a good default value for an id).

[2] Well I try to code by hand. Since I'[ve started using CSS I use
dreamweaver's layout controls for layers just so i can see if what i
want to do is possible, then re-write the css myself. since im still a
beginner at css i find this easier.

[2a] relative units can easily be put in dreamweaver, i just pixed px
because that was already there. you can rmove that and put % if you like.
 
D

David Dorward

Weyoun said:
ok well make it a class then

class="Layer1"? Its "Layer1" I'm taking issue with here, not id=.
Elements shouldn't be absolutely positioned unless they need to be.

easily fixed to percentages [2a]

Absolutely positioned is absolutely positioned, no matter what units you use
for your lengths.
well i didnt specify a font size?

You specified a height and a width. I said "sizes" not "font sizes".
 
W

Weyoun the Dancing Borg

David said:
Weyoun the Dancing Borg wrote:




class="Layer1"? Its "Layer1" I'm taking issue with here, not id=.

Well that's just the default name given in Dreamweaver (this is why you
dont like WYSIWYG hehe)

Easily changed;

www.dancingborg.co.uk/layer.gif

you can call it anything you like, and alter the coding so it's a class
(if you so wish) or leave it as an id if you want only that layer to
have specific properties.

Elements shouldn't be absolutely positioned unless they need to be.

easily fixed to percentages [2a]


Absolutely positioned is absolutely positioned, no matter what units you use
for your lengths.

sorry I misunderstood - I'm still pretty new to CSS (self evident lol)

Again, you can edit the coding afterwards.

At this point though, it's probably easier to code it by hand if you
need to edit the HTML it creates in nearly every way.


You specified a height and a width. I said "sizes" not "font sizes".

sorry, you mentioned font. But I see what you mean - if the user changes
their font size on their browser so it's 10x larger than wha I had in
mind for a normal user, then it can make the layer look stupid
 
D

David Dorward

sorry, you mentioned font. But I see what you mean - if the user changes
their font size on their browser so it's 10x larger than wha I had in
mind for a normal user, then it can make the layer look stupid

It _could_ do, but a good design is able to cope most of the time. It seems
to me that a box containing text would be better if it increased in size
along with the font size.
 
W

Weyoun the Dancing Borg

David said:
Weyoun the Dancing Borg wrote:




It _could_ do, but a good design is able to cope most of the time. It seems
to me that a box containing text would be better if it increased in size
along with the font size.

yes, sorry i should have been more clear in my reply, i meant that if
you dont have the layer increasing along with the text, then you would
end up with an odd looking layer if the user puts their font at 10x the
normal (expected) size.
 
Joined
May 8, 2022
Messages
2
Reaction score
0
I code it like this

<div id="Layer1" style="position:relative; width:relative; height:30em; z-index:1; overflow: auto;">
<table
......................................................
</table>
</div>

and work fine for my page
https://relinke.blogspot.com/2022/05/blog-post_25.html

if you define width as relative, it will work well on any screen like mobile phone. If you define width like width='10em' or else it will fix the width and the bigger width table will not be scrollable on the smaller screen.

I welcome any suggestions.

Thanks
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top