www.webdeveloper.com
Results 1 to 4 of 4

Thread: Cell table expand when use innerText

  1. #1
    Join Date
    Aug 2006
    Posts
    28

    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

  2. #2
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,357
    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)?

  3. #3
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    document.all and innerText 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 document.getElementById() (and use an id for your elements)

    And use element.firstChild.data (or element.firstChild.nodeValue) or even element.innerHTML (not standard but crossbrowser) methods but not innerText
    Last edited by Kor; 09-23-2006 at 01:16 PM.

  4. #4
    Join Date
    Aug 2006
    Posts
    28
    Quote Originally Posted by JMRKER
    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)?
    Thanks alot, very simple if I have a string with space " "

    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles