Results 1 to 6 of 6

Thread: Table replacement

  1. #1
    Join Date
    Dec 2004
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Table replacement

    I got this code:
    Code:
    <table id="Table1" bordercolor="#000000" height="75" cellspacing="0" cellpadding="0" width="435"
    		border="1">
    		<tr>
    			<td valign="middle" align="center" width="435" style="word-wrap:break-word"><span class="blacktext12">
    					<span id="ctl00_Main_ctl00_UserNetwork1_ctrlMessage">This text right here.</span>					
    				<br>
    			</span>
    			</td>
    		</tr>
    	</table>
    How can I remove this table and place another one using HTML/CSS/DHTML no JavaScript, I can add those three on the website through a module.

    Any help will be appreciated, oh maine reason is to replace the text inside.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    DHTML is the application of Javascript and CSS to make HTML "Dynamic"
    ... you can just change the code?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Dec 2004
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    well, i know that. But it says on site, that you can use HTML/DHTML and CSS but not javascript well i never used dhtml on it because it never worked.
    I can't change code just like that, its in original site, its in my profile, but they offer modules to change whatever we want in it. I was unable to figure it out, how to change text inside this table or remove the table and place a new one.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Well... you can access all the HTML inside the table with document.getElementById("Table1").innerHTML. Make what changes you like. But that's Javascript. It's not possible without Javascript.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Dec 2004
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    Well... you can access all the HTML inside the table with document.getElementById("Table1").innerHTML. Make what changes you like. But that's Javascript. It's not possible without Javascript.
    Ok, same problem different site now I can use javascript, can you elaborate on document.getElementById("Table1").innerHTML
    I'm guessing Table one is the ID where new contents go ?
    can you just show me simple code?

    thankyou

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You are right to guess that.
    Code:
    var ht = '<tr><td><img src="file.jpg" /></td><td><img src="file.png" /></td></tr>';
    document.getElementById("Table1").innerHTML = ht;
    All the HTML inside the <table> tags will be replaced by what you set the innerHTML property to. I suggest writing to a variable first, as, if you write half a piece of HTML directly to the innerHTML property, the browser may attempt to compensate, resulting in odd effects.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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