/    Sign up×
Community /Pin to ProfileBookmark

adjust table height with javascript…

well i have this div… and i want its height to be in sync with a table’s height
the div will have random txt/images in it everytime the page loads.. so obviously the height is goin to change everytime…
I want to have the table’s height to be set accordingly to the div height thru javascript

[CODE]
function adjusttableheight()
{
var divh = document.getElementById(‘content’).Height;
var setheight = divh – 360;
var tableheight = document.getElementById(‘tablecontent’).height
if(tableheight<ttldiv)
{
setheight=tableheight.Height;
}
else
{
setheight=tableheight.Height;
}

}
[/CODE]

my friend told me to do somethin like this.. but it doesnt work rly well…
the var divh is the DIV HEIGHT – Div id is “content”
the var setheight is the height i want the table to be

the var tableheight is wat it is, the table’s height…. table id=”tablecontent”
as you see, there’s a -360 in variable setheight, tht’s just something i have in there for visual functionality purposes…

so anyone find a mistake in my lil attempt at coding javascript..
do help me plz… THANK YOU VERY MUCH!!! RLY APPRECIATE IT!!!

to post a comment
JavaScript

1 Comments(s)

×

Success!

Help @yalun94 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.18,
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,
)...