How to add an image to the header of a table

S

Stefan Mueller

I've a html table with a header row and several columns. If I click on
the header of a column the function 'clicked_column(var_this)' gets
called.
Because I'm able within that function to change just on the clicked
header the mousepointer with 'var_this.style.cursor = "crosshair";' to
a cross I think that there must by also a way to add an image to the
existing header (<header title> <image>).

Does someone know if this is really possible and if yes how it can be
done?
 
S

Stefan Mueller

Great to know that it's possible.

I know that I can change the header title with
var_this.childNodes.item(0).data = "New Text";
But is it really also possible to change the image in the header
title?

Please give me a hint.
 
D

David Mark

Great to know that it's possible.

I know that I can change the header title with
  var_this.childNodes.item(0).data = "New Text";

Sort of. It depends on the content of the node (i.e. it could contain
multiple text nodes). For example, some browsers create "extra" nodes
for extraneous white space.

<th>
This might be the first child node
</th>

But is it really also possible to change the image in the header
title?

Please give me a hint.

Here's two:-

https://developer.mozilla.org/En/DOM/Document.createElement
https://developer.mozilla.org/En/DOM/Node.appendChild
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,998
Messages
2,570,242
Members
46,834
Latest member
vina0631

Latest Threads

Top