Tablesorter demo
All options included, as well as the uitheme widget
HTML
Current selection: <input class="result" type="text">
<table id="mytable">
<thead>
<tr>
<th>ID</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>2</td>
<td>
<select id="type" name="type">
<option value="1">Type 1</option>
<option value="2">Type 2</option>
</select>
</td>
</tr>
<tr>
<td>3</td>
<td>
<select id="type" name="type">
<option value="3">Type 3</option>
<option value="4">Type 4</option>
</select>
</td>
</tr>
<tr>
<td>1</td>
<td>
<select id="type" name="type">
<option value="5">Type 5</option>
<option value="6">Type 6</option>
</select>
</td>
</tr>
<tr>
<td>4</td>
<td>
<select id="type" name="type">
<option value="7">Type 7</option>
<option value="8">Type 8</option>
</select>
</td>
</tr>
<tr>
<td>5</td>
<td>
<select id="type" name="type">
<option value="9">Type 9</option>
<option value="a">Type a</option>
</select>
</td>
</tr>
<tr>
<td>7</td>
<td>
<select id="type" name="type">
<option value="b">Type b</option>
<option value="c">Type c</option>
</select>
</td>
</tr>
<tr>
<td>6</td>
<td>
<select id="type" name="type">
<option value="d">Type d</option>
<option value="e">Type e</option>
...
CSS
table {
width: 100%;
margin-top: 20px;
}
table, th, td {
border: 1px solid black;
}
JavaScript
$(function () {
$("#mytable").on('mouseleave', function(e){
if (e.target.tagName === 'TABLE') {
$(':focus').blur();
}
});
$('select').on('change', function(){
$('.result').val( this.value );
});
});