It is sometimes useful to display statistical and analytical results as a histogram with vertical (or horizontal) bars whose length is proportional to the quantities indicated. Such displays may well be generated in HTML by programs.
A simple coloured square (or rectangle) can be displayed using the <img> tag. This tag's height and width attributes can be used to stretch the image in either direction. This can be used to create simple histograms in conjunction with the <table> tag. Here's an example.
Daily Accesses | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
66 | 111 | 128 | 145 | 131 | 161 | 81 | |
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
The HTML for even this simple display requires attention to a number of details. Here's the HTML.
<table border=5> <tr valign=bottom><td valign=middle rowspan=3>Daily Accesses <td height=200><img src=green.gif height=66 width=40> <td><img src=green.gif height=111 width=40> <td><img src=green.gif height=128 width=40> <td><img src=green.gif height=145 width=40> <td><img src=green.gif height=131 width=40> <td><img src=green.gif height=161 width=40> <td><img src=green.gif height=81 width=40> <tr><td>66<td>111<td>128<td>145<td>131<td>161<td>81 <tr><td>Sun<td>Mon<td>Tue<td>Wed<td>Thu<td>Fri<td>Sat </table>
There are number of points to note here, especially if you are unfamiliar with certain aspects of tables.