2010-04-10 25 views
5

Estaba viendo un talk de Marissa Mayer de Google sobre cómo acelerar las páginas de Google. Descubrieron que un ícono de carrito de compras aumentaba el tiempo de carga en un 2% y los usuarios buscaban un 2% menos. Se las arreglaron para reemplazar el icono con una tabla HTML.Cosas que puede dibujar con tablas HTML

Aquí está mi tentativa en el dibujo de un carrito de la compra: (live example page)

<html> 
    <head> 
     <style> 
      table {border-collapse: collapse;} 
      th, td {width: 8px; height: 8px;} 
      th {background-color: blue;} 
      td {background-color: white;} 
     </style> 
    </head> 

    <body> 
     <table> 
      <!-- this row is just to see alignment --> 
      <tr> 
       <td></td><td></td><td></td><td></td><td></td> 
       <td></td><td></td><td></td><td></td><td></td> 
       <td></td><td></td><td></td><td></td><td></td> 
       <td></td><td></td><td></td><td></td><td></td> 
      </tr> 

      <!-- handle --> 
      <tr> 
       <td colspan="14"></td> 
       <th colspan="3"></th> 
       <td colspan="3"></td> 
      </tr> 
      <tr> 
       <td colspan="13"></td> 
       <th colspan="2"></th> 
       <td colspan="1"></td> 
       <th colspan="2"></th> 
       <td colspan="2"></td> 
      </tr> 
      <tr> 
       <td colspan="13"></td> 
       <th colspan="2"></th> 
       <td colspan="1"></td> 
       <th colspan="2"></th> 
       <td colspan="2"></td> 
      </tr> 
      <tr> 
       <td colspan="14"></td> 
       <th colspan="3"></th> 
       <td colspan="3"></td> 
      </tr> 

      <!-- main body --> 
      <tr> 
       <td colspan="5"></td> 
       <th colspan="13"></th> 
       <td colspan="2"></td> 
      </tr> 
      <tr> 
       <td colspan="5"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="2"></td> 
      </tr> 
      <tr> 
       <td colspan="5"></td> 
       <th colspan="1"></th> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <th colspan="1"></th> 
       <td colspan="3"></td> 
      </tr> 
      <tr> 
       <td colspan="5"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="2"></td> 
      </tr> 
      <tr> 
       <td colspan="5"></td> 
       <th colspan="1"></th> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <th colspan="1"></th> 
       <td colspan="3"></td> 
      </tr> 
      <tr> 
       <td colspan="5"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="2"></td> 
      </tr> 
      <tr> 
       <td colspan="5"></td> 
       <th colspan="1"></th> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <th colspan="1"></th> 
       <td colspan="3"></td> 
      </tr> 
      <tr> 
       <td colspan="5"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="2"></td> 
      </tr> 
      <tr> 
       <td colspan="5"></td> 
       <th colspan="1"></th> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <td colspan="1"></td> 
       <th colspan="1"></th> 
       <th colspan="1"></th> 
       <td colspan="3"></td> 
      </tr> 
      <tr> 
       <td colspan="5"></td> 
       <th colspan="13"></th> 
       <td colspan="2"></td> 
      </tr> 

      <!-- wheels --> 
      <tr> 
       <td colspan="7"></td> 
       <th colspan="2"></th> 
       <td colspan="4"></td> 
       <th colspan="2"></th> 
       <td colspan="5"></td> 
      </tr> 
      <tr> 
       <td colspan="6"></td> 
       <th colspan="4"></th> 
       <td colspan="2"></td> 
       <th colspan="4"></th> 
       <td colspan="4"></td> 
      </tr> 
      <tr> 
       <td colspan="7"></td> 
       <th colspan="2"></th> 
       <td colspan="4"></td> 
       <th colspan="2"></th> 
       <td colspan="5"></td> 
      </tr> 
     </table> 
    </body> 
</html> 

¿Qué puede usted dibujar en tablas ?! Impresione.

+0

eso no es realmente la programación relacionada. – zneak

+0

¿Es esto realmente una pregunta? –

+0

@zneak, @matti - ¡sí lo es! –

Respuesta

3

me llamó la this para this question porque estaba cansado (que querían "HTML", lo que supone que significa pura HTML). Y ese es el límite de mis habilidades para dibujar tablas.

+3

'' - haha ​​ –

+0

Guau, demasiado perezoso para anti-alias. :) – MusiGenesis

1

Uso de las fronteras de diferentes tamaños y colores que se pueden crear líneas diagonales, y evitar el aspecto pixely:

Cuestiones relacionadas