Link Direct to Table Cell


I’m new to the particular forums so I hope this is posted while in the right place.

I am designing a web site for the client and I’d like to change the content of any table cell 2 text link is clicked while in the same cell.

Is that this possible

Any help is very much appreciated!!

Its very much possible.

In order to clarify, there shall be a table personal (a td) which has a link.
Whenever this link is definitely pressed, that whole cell’s text value results in being something else And also the link will become gone also

In that case,

< html>

< head>

< title> < /title>

< script type=" text/javascript" >

purpose ChangeCell(cellId)

document. getElementById(cellId). innerHTML = " new text";

< /script>

< /head>

< body>

< table>
< tr>
< td id=" area1" > this can be a text before your change occurs. < a href=" #" onClick=" ChangeCell('area1'); " > change< /a>
< /td>
< /tr>
< /table>

< /body>

< /html>

Thanks a lot for replying so quickly bfsog!!!

The code successful but I’d like it to modify the cell text to a genuine page that is already designed. Sorry POST didn’t make this clear. If the link is as you have in your example after which it it is clicked I’d like the cell that will then display a basic page the place that the original link ended up being!!

I was also wondering whenever a a way to do it without using JavaScript as I’ve found that a majority of people block the item now

Again thanks a lot for replying and helping me!!!

Properly, to go this non JavaScript manner, your only some other alternative (bar server side) is usually to have an iframe.

< iframe src=" internet page. htm" name=" name_of_iframe" scrolling=" auto" frameborder=" no" align=" center" top = " 400px" wider = " 400px" >
< /iframe>

Then, to target (or change that) to a different page, a person’s link would read..

< a href=" pagetogoto. htm" title=" Internet page Title" target=" name_of_iframe" > link text< /a>

The target inside < a> label must match this iframe’s name cost.

Wish this helps.

Ah OK, I don’t prefer to use frames whatsoever. JavaScript it is actually then!!

Any thoughts on the idea of putting a page into a cell instead of any text string

The only real thing you could do is definitely write the whole page while in the function.


< script type=" text/javascript" >

purpose ChangeCell(cellId)

document. getElementById(cellId). innerHTML += " first line of text< br /> ";
record. getElementById(cellId). innerHTML += " second line of text< br /> ";

< /script>

Or, in case you are to do this with plenty of td’s (or what not) you could potentially store each different value (what that you’re changing the spot to) in an array.

You should keep this array in the separate file, because of this you would only have to edit the particular 1 file

Ok , i’ll know what you think.

I are convinced to do it this way would be too much effort and My business is now looking in simply changing this page!!

I will however use the particular code you revealed me for another component to the web web page.

Thanks a lot so much on your help. It truly is appreciated!!!!

This entry was posted in Web Design and tagged , , , , , , , , , , , . Bookmark the permalink.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *