HTML Tables Flashcards
The outermost tag used to create a table
The outermost tag used to create a table
Stands for “table row”.
You fill this with ‘s to add columns
Stands for “table data”
Put your content between these
Stands for “table header”
Works the same as , except it denotes visually and semantically that this is a header
colspan and rowspan
Attributes for table headers/data Both accept a unitless number value, which equals the number of rows or columns you want spanned. For example, colspan=”2” makes a cell span two columns.
You can give your table a caption by putting it inside a element and nesting that inside the element. You should put it just below the opening tag.
You can give your table a caption by putting it inside a element and nesting that inside the element. You should put it just below the opening tag.
Stands for “table row”.
You fill this with ‘s to add columns
Stands for “table data”
Put your content between these
Stands for “table header”
Works the same as , except it denotes visually and semantically that this is a header
colspan and rowspan
Attributes for table headers/data Both accept a unitless number value, which equals the number of rows or columns you want spanned. For example, colspan=”2” makes a cell span two columns.
and
You can use these to style columns more efficiently. The tag must come directly after the opening tag, and the tags are contained within the . Whatever attributes you give to each tag will be used for that column
makes the whole first and second rows have a yellow background, but not the third
You can give your table a caption by putting it inside a element and nesting that inside the element. You should put it just below the opening tag.
, , and
These elements don’t make the table any more accessible to screenreader users, and don’t result in any visual enhancement on their own. They are however very useful for styling and layout — acting as useful hooks for adding CSS to your table.
The element must wrap the part of the table that is the header — this is usually the first row containing the column headings, but this is not necessarily always the case. If you are using / element, the table header should come just below those.
The element needs to wrap the part of the table that is the footer — this might be a final row with items in the previous rows summed, for example. You can include the table footer right at the bottom of the table as you’d expect, or just below the table header (the browser will still render it at the bottom of the table).
The element needs to wrap the other parts of the table content that aren’t in the table header or footer. It will appear below the table header or sometimes footer, depending on how you decided to structure it.