Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/01/2013, 15:38
Avatar de chicohot20
chicohot20
 
Fecha de Ingreso: mayo-2009
Mensajes: 388
Antigüedad: 15 años, 8 meses
Puntos: 43
Respuesta: Prioridad de Estilos

Q Extraño!

Prueba así:
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" lang="es">
  3. <style type="text/css">
  4. .campo {
  5.   float : left;
  6.   text-align : right;
  7. }
  8. .line-through div{text-decoration: line-through;}
  9. <script type="text/javascript">
  10. function through(target) {
  11.   target.parentNode.parentNode.setAttribute("class", "line-through");
  12. }
  13. </head>
  14. <table border="1">
  15.   <tr>
  16.     <td>
  17.       <table border="1">
  18.         <tr>
  19.           <td>&nbsp;</td>
  20.           <td>&nbsp;</td>
  21.         </tr>
  22.       </table>
  23.     </td>
  24.   </tr>
  25.   <tr>
  26.     <td>
  27.       <table border="1">
  28.         <tr><!-- Aquí aplico el estilo -->
  29.           <td><div onclick="through(this);">campo1</div></td>
  30.           <td><div class="campo">campo2</div></td>
  31.         </tr>
  32.       </table>
  33.     </td>
  34.   </tr>
  35. </body>
  36. </html>