Table body font size : table size « Tags « HTML / CSS






Table body font size

     

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title> My favorite records  </title>
        <style rel='stylesheet' type='text/css'>
body {
    margin: 0;
}
table {
    width: 200px;
    border: thin solid black;
}
th, tfoot td {
    border: thin solid black;
    text-align: center;
    font-weight: bold;
}
tbody td {
    font-size: 120%;
}
caption {
    font-size: 90%;
    text-align: right;
}
td, th, caption {
    padding: 5px;
}
        </style>
    </head>
    <body>
        <div style='width: 200px;
                     height: 30px;
                     background: gray;
                     color: white;
                     text-align: center;'>
        &lt; -- 200 pixels -- &gt;
      </div>
        <table>
            <caption>
                Table: My favorite records.
            </caption>
            <colgroup>
                <col id='album' />
                <col id='artist' />
                <col id='released' />
            </colgroup>
            <thead>
                <tr>
                    <th> album            </th>
                    <th> artist           </th>
                    <th> released         </th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td> R</td>
                    <td> T</td>
                    <td> 1</td>
                </tr>
                <tr>
                    <td> B</td>
                    <td> V</td>
                    <td> 1</td>
                </tr>
                <tr>
                    <td> Q</td>
                    <td> Q</td>
                    <td> 1</td>
                </tr>
                <tr>
                    <td> M</td>
                    <td> T</td>
                    <td> 1</td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
            </tbody>
            <tfoot>
                <tr>
                    <td> album            </td>
                    <td> artist           </td>
                    <td> released         </td>
                </tr>
            </tfoot>
        </table>
    </body>
</html>

   
    
    
    
  








Related examples in the same category

1.Sized Table
2.Sized or Stretched Table
3.Right-offset Sized Table
4.Right-aligned Sized Table
5.Centered Sized Table
6.Left-offset Sized Table
7.tbody td font-size: 120%;
8.'cellpadding' sets the empty width between a cell's border and its content
9.'cellspacing' sets the width of the empty space between cells in a table
10.Table width 200px
11.Set table width, margin and text align
12.A table with auto width only expands enough to accomodate its content
13.table width: 350px;
14.table border-width: 1px;
15.table width:250px;
16.table width: auto;
17.table width: 95%;
18.An HTML table with width and float attributes
19.table width: 50%; margin: 0 auto; text-align: left;
20.table with auto width
21.table width: 100%;border: thin solid black;border-spacing: 15px 0;
22.table border-style:solid; border-width:1px; border-color:#666666;
23.table width: 100%;
24.Table width: auto
25.table auto width and height
26.Column Width: percentage, auto and px
27.Shrinkwrapped Table column width
28.table width: 100%
29.Fixed Table with fixed width
30.Adding auto width to a Table
31.Left-offset Shrinkwrapped Table
32.Right-offset Shrinkwrapped Table
33.Indented Stretched Table
34.Stretched Table