/    Sign up×
Community /Pin to ProfileBookmark

table cells resizing unexpectedly

Hi. I’m just wondering if anyone can give me any ideas about why the following code would resize the table cell height only on IE5/Mac, making the cell taller than 30px, pushing the entire contents down on the page.

The javascript function place in the head:

function clearChose(theSelect) {
//check if option has been stripped already
if (theSelect.options[0].value == 0) {
if (theSelect.options[theSelect.selectedIndex].value != 0) {
var n2 = theSelect.selectedIndex;
var optLen = theSelect.length;
for (var loop = 0; loop < (optLen-1); loop++) {
theSelect.options[loop].value = theSelect.options[loop+1].value; //strip off the first option value
theSelect.options[loop].text = theSelect.options[loop+1].text;//strip off the first option text
}
theSelect.length-=1; //set to right length
theSelect.selectedIndex=n2-1; //set the selected value
}
}
}

The html code placed in the body:

<tr>
<td style=”height:30px”>
<div align=”right”>Hand:</div>
</td>
<td>
<select name=”Hand” onChange=”clearChose(document.form2.elements[‘Hand’]);”>
<option value=”0″>Choose One</option>
<option value=”Left Hand”>Left Hand</option>
<option value=”Right Hand”>Right Hand</option>
</select>
</td>
</tr>

Any thoughts would be much appreciated.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@CharlesAug 08.2003 — [font=georgia]The problem is that you are using TABLEs for layout which you ought not to be doing. [/font][i]From the HTML 4.01 Specification:[/i]

[b]Tables should not be used purely as a means to layout document content as this may present problems when rendering to non-visual media. Additionally, when used with graphics, these tables may force users to scroll horizontally to view a table designed on a system with a larger display. To minimize these problems, authors should use style sheets to control layout rather than tables.[/b]

[i]http://www.w3.org/TR/html4/struct/tables.html#h-11.1[/i][/quote]
Copy linkTweet thisAlerts:
@cflynnauthorAug 08.2003 — Yes, that would be optimal, but I didn't do the design. I'm doing a database and scripting for a client and I don't really want to rework the whole site for just one browser.

Thanks for the link.

Any other ideas about why this script would not be working on IE5 on Mac?

Thanks.
Copy linkTweet thisAlerts:
@CharlesAug 08.2003 — [font=georgia]It's more than one browser, it's all the audio and Braille browsers out here. If your client is in the US tell them about the ADA and charge them a bundle to bring the site up to code.[/font]
×

Success!

Help @cflynn 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...