S
Stefan Mueller
I've a table with several columns. The header row of the table looks
like
<th class = "style_table">
<div class = "style_column">
Header of Column 1
</div>
</th>
<th class = "style_table">
<div class = "style_column">
Header of Column 2
</div>
</th>
...
Now I'd like to add to each header an image.
If I do it with
var image = document.createElement("img");
image.setAttribute("src", "myimage.gif");
this.appendChild(image);
the header of each column looks like
<th class = "style_table">
<div class = "style_column">
Header of Column 1
</div>
<img src = "myimage.gif">
</th>
But I'd like to have '<img src = "myimage.gif">' within the divisions:
<th class = "style_table">
<div class = "style_column">
Header of Column 1
<img src = "myimage.gif">
</div>
</th>
I know that I can do this if I add to each division an ID. But is
there also a way to do it without using IDs?
like
<th class = "style_table">
<div class = "style_column">
Header of Column 1
</div>
</th>
<th class = "style_table">
<div class = "style_column">
Header of Column 2
</div>
</th>
...
Now I'd like to add to each header an image.
If I do it with
var image = document.createElement("img");
image.setAttribute("src", "myimage.gif");
this.appendChild(image);
the header of each column looks like
<th class = "style_table">
<div class = "style_column">
Header of Column 1
</div>
<img src = "myimage.gif">
</th>
But I'd like to have '<img src = "myimage.gif">' within the divisions:
<th class = "style_table">
<div class = "style_column">
Header of Column 1
<img src = "myimage.gif">
</div>
</th>
I know that I can do this if I add to each division an ID. But is
there also a way to do it without using IDs?