Table footer background and color : footer « Layout « HTML / CSS






Table footer background and color

 



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
        <head>
            <title>Hummus</title>
            <style type='text/css' media='all'>
                table {
                    border-width: 0px;
                    width: 500px;
                }
                th {
                    background: black;
                    color: white;
                }
                tfoot td {
                    background: #808080;
                    color: white;
                }
            </style>
        </head>
        <body>
            <table>
                <thead>
                    <tr>
                        <th colspan='4'>
                            Hummus
                        </th>
                    </tr>
                    <tr>
                        <th>
                            #
                        </th>
                        <th>
                            Measurement
                        </th>
                        <th>
                            Product
                        </th>
                        <th>
                            Instructions
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>1</td>
                        <td>C</td>
                        <td colspan='2'>T</td>
                    </tr>
                    <tr>
                        <td>2</td>
                        <td>T</td>
                        <td>P</td>
                        <td>C</td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan='4'>
                             This is a test. This is a test. 
                        </td>
                    </tr>
                </tfoot>
            </table>
      </body>
   </html>

 








Related examples in the same category

1.Fixed footer
2.Mark footer with DIV
3.Set paragraph in footer
4.Set footer to left clear
5.Header, footer, side bar and content
6.Footer: clear left
7.3 column layout with equalising columns and footer
8.Footer layout
9.Footer with bottom offset
10.footer border