/    Sign up×
Community /Pin to ProfileBookmark

I got a javascript that reads the height and width of a frame.
I want to give the table the same height and width, but i can’t get it to work. ?

[b]This is my javascript:[/b]

function FrameHeight()
{
if (document.layers) {
height = window.innerHeight;
}
else if (document.all) {
height = document.body.clientHeight;
}
}

function FrameWidth()
{
if (document.layers) {
width = window.innerWidth;
}
else if (document.all) {
width = document.body.clientWidth;
}
}

[b]And here is my table:[/b]

<TABLE BORDER=”0″ CELLPADDING=”0″ CELLSPACING=”0″ HEIGHT=”FrameHeight()” WIDTH=”FrameWidth()”>
<TR>
<TD ALIGN=”center” VALIGN=”middle” STYLE=”border-top: 1 solid #000000; border-bottom: 1 solid #000000″><IMG SRC=”gfx/uc.jpg” BORDER=”0″ WIDTH=”600″ HEIGHT=”200″ ALIGN=”bottom”></TD>
</TR>
</TABLE>

Can someone please help me. I know my javascript are working.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisJan 10.2003 — It would be nice if it were that easy.

Use a script to create the table tag:

[font=monospace]<script type="text/javascript" language="JavaScript">

document.write('<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" HEIGHT="' + FrameHeight() + '" WIDTH="' + FrameWidth() + '">');

</script>

<noscript><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" HEIGHT="100%" WIDTH="100%"></noscript>[/font]

followed by the rest of the table.
Copy linkTweet thisAlerts:
@NicodemasJan 10.2003 — [B]Write your table like so....substituting this code for your table code.[/B]


<script>

document.writeln("<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" HEIGHT="" + height + "" WIDTH=+"" + width + "">")

document.writeln("<TR>")

document.writeln("<TD ALIGN="center" VALIGN="middle" STYLE="border-top: 1 solid #000000; border-bottom: 1 solid #000000"><IMG SRC="gfx/uc.jpg" BORDER="0" WIDTH="600" HEIGHT="200" ALIGN="bottom"></TD>")

document.writeln("</TR>")

document.writeln("</TABLE>")

</script>
Copy linkTweet thisAlerts:
@RidlrauthorJan 10.2003 — Thanks all for the help ?
×

Success!

Help @Ridlr 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.14,
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,
)...