CNB CNB - 2 months ago 8
HTML Question

HTML5 and <table> "style" attribute

I´ve just started learining this new, wonderful skill (HTML5) and everything was going smooth up untill I got to able styling. OK, I know that CSS is made for that, but as it´s a little bit too early for me I use ´style´ attribute. OK, so I wrote this simple table:

<!Doctype html>

<html lang="es-es">

<head>
<meta charset="UTF-8">
<title>First table</title>
<meta name="author" content="Kamila Bertran">
</head>

<body>

<table style=”border:1px solid #000; width:100%;”>

<caption> Gastos mensuales </caption>

<thead>
<tr>
<td style=”border:1px solid #000; width:100%;”> Producto </td>
<td style=”border:1px solid #000; width:100%;”> Unidades </td>
<td style=”border:1px solid #000; width:100%;”> Precio </td>
<td style=”border:1px solid #000; width:100%;”> Total </td>
</tr>
</thead>

<tfoot>
<tr>
<td colspan=2 style=”border:1px solid #000; width:100%; align:center;”> Año 2014</td>
<td style=”border:1px solid #000; width:100%;”> Total</td>
<td style=”border:1px solid #000; width:100%;”> 142 </td>
</tr>
</tfoot>

<tbody>
<tr>
<td style=”border:1px solid #000; width:100%;”> Camisetas </td>
<td style=”border:1px solid #000; width:100%;”> 10 </td>
<td style=”border:1px solid #000; width:100%;”> 2 </td>
<td style=”border:1px solid #000; width:100%;”> 20 </td>
</tr>

<tr>
<td style=”border:1px solid #000; width:100%;”> Pantalones </td>
<td style=”border:1px solid #000; width:100%;”> 3 </td>
<td style=”border:1px solid #000; width:100%;”> 14 </td>
<td style=”border:1px solid #000; width:100%;”> 42 </td>
</tr>

<tr>
<td style=”border:1px solid #000; width:100%;”> Chaquetas </td>
<td style=”border:1px solid #000; width:100%;”> 4 </td>
<td style=”border:1px solid #000; width:100%;”> 20 </td>
<td style=”border:1px solid #000; width:100%;”> 80 </td>
</tr>
</tbody>

</table>

</body>

</html>


and cannot undestand why my ´style´ attribute is being completly ignored. Help?

Answer

you used ( ” ).This is wrong.You must use ( " ) Like this

        <tr>
            <td style="border:1px solid #000; witdh:100%;"> Camisetas </td>
            <td style="border:1px solid #000; width:100%;"> 10 </td>
            <td style="border:1px solid #000; width:100%;"> 2 </td>
            <td style="border:1px solid #000; width:100%;"> 20 </td>
        </tr>

Also