CS174
Chris Pollett
Feb 10, 2021
<h1>heading1</h1> <h2>heading 2</h2> <h3>heading</h3> <!--this is okay, should not do things like skip from an h2 to an h4 tag without an h3 tag in between. Screen readers use these headings to extract a table of contents for the document -->
<ul> <li>List Item 1</li> <li>List Item 2 <ul> <li>Sub List Item</li> </ul> </li> </ul>
|
<ol> <li>List Item 1</li> <li>List Item 2 <ol> <li>Sub List Item </li> </ol> </li> </ol>
|
<a href="http://www.somewhere.com/">somewhere</a>
<img src="myphoto.gif" alt="This is a picture of me" />
& | & |
< | < |
> | > |
(hard space) | |
" | " |
Σ | Σ |
Below is an example table we discussed:
<style> table, th, td { border: 1px solid black; border-collapse: collapse; } </style> <table> <caption>grade table</caption> <tr><td></td><th>Item</th><th>Value</th></tr> <tr><th>1.</th><td>Homeworks</td><td>50%</td></tr> <tr><th>2.</th><td>Exams</td><td>50%</td></tr> </table>
Item | Value | |
---|---|---|
1. | Homeworks | 50% |
2. | Exams | 50% |
Note: Although in this example we used the <style> tag immediately before the table, for this to be valid html, all style tags would need to be in the <head> of the document.
You can make table headings or table data span more than one column or more than one row using colspan, rowspan:
<tr><th colspan="3">heading</th></tr>
Here is an example where we have two levels of headings at the top of a table:
<tr><th colspan="2">heading</th></tr> <tr><th>subhead1</th><th>subhead2</th></tr> <tr><td>1</td><td>2</td></tr>