Maybe this question is so easy… I understand html, css, the dom and javascript pretty good, but I’m having a very tough time while trying to get jQuery to work for me. Let’s say I have the following 4 columns table, with columns 1 and 3 hidden:
<table id="mytable">
<thead>
<tr>
<th class="hidden">Column1</th>
<th>Column2</th>
<th class="hidden">Column3</th>
<th>Column4</th>
</tr>
</thead>
<tbody>
<tr>
<td class="hidden">Value1</td>
<td>Isle of Palms</td>
<td class="hidden">Value3</td>
<td>Value4</td>
</tr>
</tbody>
</table>
Then I use the following code to hide the hidden class columns:
$(function() {
$('.hidden').hide();
});
Yesterday some of you told me how to get the first column content by using:
$(function() {
$(this).find('td.hidden:first').html();
});
What I want to do is to show an alert or Thickbox showing the header name and cell value for all the hidden columns:
Column1 = Value1
Column3 = Value3
If it were easier to do, I could group all the hidden columns at the beginning (to the left) of the table.
Thanks in advance.
Try this out
Read more up on
indexI haven’t tested it, but if any, there should only be minor silly errors.Tested here http://jsfiddle.net/mb6Gd/