/    Sign up×
Community /Pin to ProfileBookmark

Cell table expand when use innerText

I have table:

<table width=”500″ border=”1″>
<tr>
<td width=”90″ id=”mk”>&nbsp;</td>
<td width=”394″>&nbsp;</td>
</tr>
</table>

and button with onClick even:
<input type=”button” name=”insert” value=”insert” onClick=”document.all.mk.innerText=’aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'”>

BUT width of cell will expand enough for string

I want when insert, height of cell is changed, width of cell isn’t changed

I think must be table attribute to solve this problem.
I have found, but I see nothing

So what should I do
Please help me
Thanks a lot

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERSep 23.2006 — Do you get the same effect when

onClick="document.all.mk.innerText='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'">

looks like

onClick="document.all.mk.innerText='aaaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaaa aaaaa aaaaa aaaaa aaaaa aa'">

(space location is arbituary)?
Copy linkTweet thisAlerts:
@KorSep 23.2006 — [B]document.all[/B] and [B]innerText[/B] are decrepited IE only and they are not standard javascript methods. You must use a standard and crossbrowser solution (IE accepts them as well) on using [B]document.getElementById()[/B] (and use an id for your elements)

And use [I]element[/I].[B]firstChild.data[/B] (or [I]element[/I].[B]firstChild.nodeValue[/B]) or even [I]element[/I].[B]innerHTML[/B] (not standard but crossbrowser) methods but not [B]innerText[/B]
Copy linkTweet thisAlerts:
@minhkhoiauthorSep 24.2006 — Do you get the same effect when

onClick="document.all.mk.innerText='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'">

looks like

onClick="document.all.mk.innerText='aaaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaaa aaaaa aaaaa aaaaa aaaaa aa'">

(space location is arbituary)?[/QUOTE]


Thanks alot, very simple if I have a string with space " "

Thanks
×

Success!

Help @minhkhoi 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.13,
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,
)...