Ver Mensaje Individual
  #3 (permalink)  
Antiguo 06/11/2014, 02:36
Avatar de chabri
chabri
 
Fecha de Ingreso: septiembre-2009
Ubicación: Torremolinos
Mensajes: 227
Antigüedad: 14 años, 7 meses
Puntos: 17
Respuesta: Seleccionar Columna de una tabla

Muy buenas, he pensado algo como me comentas, pero necesito algo mas global, he creado esto pero no me termina de ir bien:

js:
Cita:
$(".select-column th input").click(function(){
var columnNo = $(this).index();
$(this).closest("table")
.find("tr td:nth-child(" + (columnNo+1) + ")")
.toggleClass('full');
});
HTML:
Cita:
<table class="table table-month selectable">
<thead>
<tr class="select-column">
<th >
<label>
<input type="checkbox" value="opcion_1"> Week
</label>
</th>
<th class="">
<label>
<input type="checkbox" value="opcion_1"> Monday
</label>
</th>
<th>
<label>
<input type="checkbox" value="opcion_1"> Tuesday
</label>
</th>
<th>
<label>
<input type="checkbox" value="opcion_1"> Wednesday
</label>
</th>
<th>
<label>
<input type="checkbox" value="opcion_1"> Thursday
</label>
</th>
<th>
<label>
<input type="checkbox" value="opcion_1"> Friday
</label>
</th>
<th>
<label>
<input type="checkbox" value="opcion_1"> Saturdays
</label>
</th>
<th>
<label>
<input type="checkbox" value="opcion_1"> Sundays
</label>
</th>
</tr>
</thead>
<tbody>


<tr class="select-row">
<th></th>
<td> </td>
<td> </td>
<td> </td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>