/    Sign up×
Community /Pin to ProfileBookmark

Display problem

Hope someone can help me out with this, I have been trying and just can’t find where went wrong.

For the following code, i need to click on the “Here”, then the information extent out. But the problem is after it extended out, the words are cramped together. The box width is “600”, but it doesn’t display “600” width.i need to them spread out so looks more presentable.

Thanks very much.

[CODE]
<tr><td align=left>
<p>
<div style=”position:relative;”>
<a href=”#1″ onClick=”toggleDiv(‘div1’);return false;”><span class=”style8″><b>Here:</span></b></a>
<p> <form name=”first” id=”div1″>

<table border=”0″ align=”center” width=”100%” style=”border:1px dashed #000000;” cellpadding=”0″ cellspacing=”10″>

<tr><td width=”600″ valign=”top”>

<tr><td><span class=”style8″>Population density/km<sup>2</sup>, p<sub>u</sub></span>:</td><td><input name=PU type=text size=15 onkeyup=checnum(this) ></td></tr>
<tr><td><span class=”style8″>Area km<sup>2</sup>, A<sub>u</sub></span>:</td><td><input name=AU type=text size=15 onkeyup=checnum(this) ></td></tr>
<tr><td><span class=”style8″>Total population, P<sub>u</sub></span>: <input type=button name=ss value== onclick=A3() class=calc></td><td><input name=a3 type=text readonly > </td></tr>
</form>

<form name=second>

<tr><td><span class=”style8″>Population density/km<sup>2</sup>, p<sub>u</sub></span>:</td><td><input name=PU type=text size=15 onkeyup=checnum(this) ></td></tr>
<tr><td><span class=”style8″>Mobile-market penetration %, m<sub>u</sub></span>:</td><td><input name=MU type=text size=15 onkeyup=checnum(this) ></td></tr>
<tr><td><span class=”style8″>User/subscribers, s<sub>u</sub></span>: <input type=button name=ss value== onclick=A5() class=calc></td><td> <input name=a5 type=text readonly > </td></tr>

</form>

<form name=third>

<tr><td><span class=”style8″>Users/subscribers, s<sub>u</sub></span>:</td><td><input name=SU type=text size=15 onkeyup=checnum(this) ></td></tr>
<tr><td><span class=”style8″>Area km<sup>2</sup>, A<sub>u</sub></span>:</td><td><input name=AU type=text size=15 onkeyup=checnum(this) ></td></tr>
<tr><td><span class=”style8″>Total No. of Users/subscribers, S<sub>u</sub></span>: <input type=button name=ss value== onclick=A6() class=calc></td><td> <input name=a6 type=text readonly > </td></tr>

</form>
</div>
</table>
[/CODE]

to post a comment
HTML

11 Comments(s)

Copy linkTweet thisAlerts:
@FangFeb 25.2009 — Give a full working example; the root cause of the problem can not be found from this snippet.

Validate the document; many problems are resolved with valid documents.
Copy linkTweet thisAlerts:
@kereneauthorFeb 25.2009 — This is a whole thing. Thanks very much.


[CODE]

<script type="text/javascript">
function toggleDiv(id) {
var obj=document.getElementById(id).style;
obj.visibility = (obj.visibility == "visible")? "hidden" : "visible";
}

</script>




<script type="text/javascript">
function toggleDiv(id) {
var obj=document.getElementById(id).style;
obj.display = (obj.display == "block")? "none" : "block";
}
</script>

<style type="text/css">
#div1{position:absolute;display:none; z-index:999;
width:200px; font-size: 12px; color: blue; background:#fff;}
#div1 {position:relative;}

</style>



<body bgcolor="white">


<tr><td align=left>
<p>
<div style="position:relative;">
<a href="#1" onClick="toggleDiv('div1');return false;"><span class="style8"><b>Design Parameters</span></b></a>
<p> <form name="first" id="div1">



<table border="0" align="center" width="100%" style="border:1px dashed #000000;" cellpadding="0" cellspacing="10">

<tr><td width="600" valign="top">
<tr><td><span class="style8">Population density/km<sup>2</sup>, p<sub>u</sub></span>:</td><td><input name=PU type=text size=15 onkeyup=checnum(this) ></td></tr>
<tr><td><span class="style8">Area km<sup>2</sup>, A<sub>u</sub></span>:</td><td><input name=AU type=text size=15 onkeyup=checnum(this) ></td></tr>
<tr><td><span class="style8">Total population, P<sub>u</sub></span>: <input type=button name=ss value== onclick=A3() class=calc></td><td><input name=a3 type=text readonly > </td></tr>
</form>


<form name=second>

<tr><td><span class="style8">Population density/km<sup>2</sup>, p<sub>u</sub></span>:</td><td><input name=PU type=text size=15 onkeyup=checnum(this) ></td></tr>
<tr><td><span class="style8">Mobile-market penetration %, m<sub>u</sub></span>:</td><td><input name=MU type=text size=15 onkeyup=checnum(this) ></td></tr>
<tr><td><span class="style8">User/subscribers, s<sub>u</sub></span>: <input type=button name=ss value== onclick=A5() class=calc></td><td> <input name=a5 type=text readonly > </td></tr>

</form>


<form name=third>

<tr><td><span class="style8">Users/subscribers, s<sub>u</sub></span>:</td><td><input name=SU type=text size=15 onkeyup=checnum(this) ></td></tr>
<tr><td><span class="style8">Area km<sup>2</sup>, A<sub>u</sub></span>:</td><td><input name=AU type=text size=15 onkeyup=checnum(this) ></td></tr>
<tr><td><span class="style8">Total No. of Users/subscribers, S<sub>u</sub></span>: <input type=button name=ss value== onclick=A6() class=calc></td><td> <input name=a6 type=text readonly > </td></tr>

</form>
</div>
</table>

[/CODE]
Copy linkTweet thisAlerts:
@CharlesFeb 25.2009 — No wonder. [url=http://validator.w3.org/]Validate[/url] that document and then let us know if the problem hasn't gone away.
Copy linkTweet thisAlerts:
@kereneauthorFeb 26.2009 — I have validated the codes, there are 18 errors. I tried to edit it and errors keep increasing.It just didnt solve that problem. Please advice on where the problem is. Thanks very much
Copy linkTweet thisAlerts:
@FangFeb 26.2009 — The form tags are not allowed in a table. Why are you using more than 1 form?
Copy linkTweet thisAlerts:
@kereneauthorFeb 26.2009 — Because there are 3 different calculations need to do and i need to display them in 1 table. Is there any other way?
Copy linkTweet thisAlerts:
@FangFeb 26.2009 — Yes, 1 form.
Copy linkTweet thisAlerts:
@kereneauthorFeb 26.2009 — So the problem is with the form. Ok got it..thank u. ?
Copy linkTweet thisAlerts:
@CharlesFeb 26.2009 — So the problem is with the form. Ok got it..thank u. ?[/QUOTE]Perhaps. It is likely that you have others as well. Read, mark, learn and inwardly digest http://www.w3.org/TR/html401/ .
Copy linkTweet thisAlerts:
@kereneauthorFeb 26.2009 — Thanks for the site. Im at the very very begining level of web programming and currently doing a school project and need a lot of help from the experts.

Thanks! ?
Copy linkTweet thisAlerts:
@CharlesFeb 26.2009 — It may seem picky but it is important to not think about HTML as programming. You're not telling something to do something. You are describing how the parts of a document work together. HTML is about meaning. And on the web you never get to instruct; at most you can only ask.
×

Success!

Help @kerene 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.21,
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,
)...