On this page we will discuss what a HTML table is, where it’s used, and how its construction affects the way TableMaster works.
What is a Table?
The “Tables” feature of HTML is widely used. The most obvious use is for presenting information in a tabular format, but web designers have found it to be handy for many other uses as well. In particular it provides an easy way for controlling where on a web page information will appear.
What are the components of a table?
A table consists of zero of more sections, of various types:
Within each section there are rows, and in each row there are columns. The number of columns may vary from one row to the next.
What are headers for?
A “header” is a way for the web designer to tell the browser that the information in these rows represents a title, rather than data. So usually in header rows we will see column captions rather than data.
Does this mean that if there is no header the table will not have captions?
No. It doesn’t. Often web designers will create a table with a single body only, and will individually format the top one or two rows to give them a separate appearance to the rest of the table.
What are bodies for?
A “body” is a way for the web designer to tell the browser that the information in these rows represents data. Having said that it is not uncommon for web designers to format the top row(s) to give the appearance of a title row, and/or the last row(s) to give the appearance of a summary row.
While it’s usual for there to be only one body, it is possible to create more than one body. This is a way to indicate to the browser that there is more that one group of data being displayed.
What are footers for?
A “footer” is a way for the web designer to tell the browser that the information in these rows represents summary information, rather than data. So usually in header rows we will see things like totals or conclusions.
Does this mean that if there is no footer the table will not have totals?
No. It doesn’t. Often web designers will create a table with a single body only, and will individually format the last rows to give them a separate appearance to the rest of the table.
How does TableMaster work with Headers, Footers and Bodies?
Naturally when TableMaster sorts or filters rows, it wants to exclude titles and totals. If there is a header it’s easy for TableMaster to know which rows are title rows, and if there is a footer it’s easy to understand which are summary rows. These rows are excluded from sorting and filtering.
If there is no header, TableMaster will assume the first row of the first body is acting as a header row, and it will exclude that row from sorting and filtering. There will be an option on that row’s menu to return it to be a regular body row. Alternately, there will be an option on the next row allowing you to turn it into a header row as well.
If there is no footer, TableMaster will assume there is no summary row, but there will be an option on the last row’s menu to turn into a footer.
If there is more than one body, TableMaster will sort each body separately.
Not all rows have the same number of columns. A row can have fewer columns than the other rows, or one of the columns in the middle might span more than one row. Look at the following example:
|Column A||Column B||Column C|
|Row 1||Has all columns||Has all columns|
|Row 2||Does not have column C|
Column A Spans 2 Columns
So it has columns A and C only
When TableMaster sorts the rows it will:
- For column A: relate to all rows
- For column B: ignore row 3 – it will always appear at the top
- For column C: ignore row 2 – it will always appear at the top
When TableMaster filters the rows it will:
- For column A: relate to all rows
- For column B: row 3 will always be filtered out
- For column C: row 2 will always be filtered out