Menu ▾ ▴

#8 <sup> tags in header in the wrong place

open
nobody
None
5
2014-08-25
2006-06-07
Anonymous
No

Try the following code:

the sup tags are moved from left to right.

<html><head>

<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/css.js"></script>
<script type="text/javascript"
src="js/standardista-table-sorting.js"></script>

</head><body>

<table class="sortable">
<thead>
<tr>
<th>
something1<sup>1</sup>
</th>
<th>
something2<sup>2</sup>
</th>
<th>
something3<sup>3</sup>
</th>
</tr>
</thead>
<tbody>

<tr>
<td>
<a href="123.html">
asd
</a> </td>
<td>
<a href="123.html">
ggggg
</a> </td>
<td>
<a href="123.html">
dfgdfg
</a> </td>
</tr>

</tbody>
</table>

</body>

</html>

Discussion

  • Nobody/Anonymous

    Logged In: NO

    I mean not the sup tags themselves, but their rendering. ;-)

     
  • Nobody/Anonymous

    Logged In: NO

    You can circumfence the problem by using innerHTML instead of appendChild:

    Change:

    // move the current contents of the cell that we're
    // hyperlinking into the hyperlink
    var innerEls = th.childNodes;
    for (var j = 0; j < innerEls.length; j++) {
    linkEl.appendChild(innerEls[j]);
    alert(j + " : " + innerEls[j] + " : " + innerEls[j].innerHtml);
    }

    to something like:

    linkEl.innerHTML = th.innerHTML;
    th.innerHTML = "";

     

Log in to post a comment.