/    Sign up×
Community /Pin to ProfileBookmark

height/width as %’s: what am I doing wrong?

Okay, I thought I understood how this worked, but clearly I was wrong. For some reason, the following layout works fine until I start trying to place images into the table cells. I was under the impression that using “height=100% width=100%” caused the image to fill the available space (and I’ve seen it do this before), but what is happening here is completely different.

As soon as I put in images, it starts ignoring the parameters I’ve given for the table (and what’s really wonky is, I’ve tried different images in that bottom cell, and they all come out the same way.. any image wider than it is tall has the same effect – if you don’t feel like d/ling the jpeg I attached, feel free to use your own). Internet Explorer and Mozilla seem to react to it differently, but neither one is doing what I want.

Note that setting height to 100% and leaving the width blank causes the image to appear in the correct manner, but the cell remains stretched way off into nowhere.

I’ve tried all kinds of variations on adding extra information to the table rows and cells to specify exactly what they are supposed to be, to no avail, and even tried using blocks with css, STILL getting bad results. Could someone please either tell me what I’m doing wrong, or show me another way to do it?

[CODE]<html>
<head>
</head>

<body>
<table border=1 width=100% height=100%>
<tr height=79%>
<td width=71%>1
</td>
<td rowspan=2 width=29%>2
</td>
</tr>
<tr height=21%>
<td>
<img src=”bottom_bg.jpg” height=100% width=100%>
</td>
</tr>
</table

</body>
</html>[/CODE]

[upl-file uuid=a820ee7a-28ba-43eb-bf05-bdc1f4172678 size=24kB]bottom_bg.jpg[/upl-file]

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@DARTHTAMPONApr 10.2005 — This can not be done using html. Html needs has to be able to know the size befor the page loads so using %'s will not work. I have seen it done befor with javascript using lots of code but damned if I can find it. It involves using js to use a function that runs ever time the window changes size and then rewrites the graphic. I will keep looking for the tutorial and if i find it I will post it.

If anybody else knows of a tuterial please post.
×

Success!

Help @Malkalypse 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.11,
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,
)...