TablesTables are html elements that are used to hold tabular data. So for instance, tables could be used to represent a timetable or a collection of data from a survey. In years gone by, tables were used to construct entire layouts of web pages. Nowadays, using tables for this purpose is semantically incorrect and the use of tables are less flexible than divs are, especially when it comes to utilizing media queries for responsive design.
This weeks lab work consisted of building three tables to show the use of 'rowspan' and 'colspan'. The use of 'rowspan' within a tabular data cell allows for the cell to expanded downwards over however many rows are specified. In a timetable, this would be used to show lectures which span more than 1 hour (or more than one row). Conversely, 'colspan' allows for cells to be merged across columns. This could be used for setting the title of the table to span the entire first row of the table.
When constructing a table the use of table header tags are also available for use. Table header tags put emphasis on the first entries to the table so the user can see what type of data is being displayed clearly. Similarly, table body tags can then be used to define the area of the table which contains the main body of the data.
W3C ValidatorThe w3c validator is a tool which was developed by the W3C, which stands for the World Wide Web Consortium, in order to validate and check the quality of HTML and XML documents in accordance with the w3c's standards as well as ISO standards (ISO 8879 & ISO/IEC 15445). To validate a web page you can do one of the following:
- Upload your document
- Validate an already hosted document
- Validate via direct text input
For the final part of our lab work, we were asked to validate two web pages and to correct the errors that were given by the w3c validator. Using semantically safe design and development ensures minimal output of errors. The non-use of header tags within articles and sections was deemed as an error as were the use of sections as general content holders. Correcting these issues and re-uploading the documents proved to be successful in eliminating the w3c's warnings.