Traditionally, tables have been used for displaying tabular data (such as numbers) in rows and columns. The flexibility of HTML, however, enables Web developers to create tables that display more than just numbers. In fact, as important as the capability to display tabular data is, even more important to Web designers is the capability to control the layout of other document elements (such as text and images). Table
Caution Although HTML tables look similar to your favorite spreadsheet, HTML tables don't perform mathematical functions. HTML tables are not difficult to create, but they do require some organization. All HTML tables begin with the <table> tag and end with the </table> tag. In between those tags are three other tags to be aware of, as follows:
Remember that Web browsers ignore any spaces, tabs, and blank lines that you include in your HTML document. So, feel free to use spacing to help you keep track of the table tags. Figure 7.1 shows enough blank spaces between the tags so that you can see the rows and columns lining up. It makes it easier to ensure that you don't forget any tags. Figure 7.2 shows how that table looks in a browser. Figure 7.1. A simple two-column, three-row HTML table.Figure 7.2. That same HTML table as it appears in the browser. |