0912 Head First HTML and CSS — Study Log #11
Chapter 13. Tables and More Lists: Getting Tabular
Keyword: table list
- HTML tables are used to structure tabular data.
- Use the HTML table elements
<table>,<tr>,<th>, and<td>together to create a table. -
You can provide additional information about your tables with the
<caption>element. - Table cells don’t have margins; what they have is spacing around their borders (
border-spacing), and this spacing is set for the entire table. You can’t control the border spacing of each table cell separately. - You can use a CSS property called
border-collapseto collapse the borders so that there is no border spacing at all. - Use the CSS
nth-childpseudo-class to add background color to every other row of a table. rowspancolspan- If you have no data for a data cell, put no content into the
<td>element. You need to use a<td>...</td>element to maintain the alignment of the table, however. .nestedtablelist-style-type
table{
margin-left: 20px;
margin-right: 20px;
border: thin solid black;
caption-side: bottom;
border-collapse:collapse;
}
td, th{
border: thin dotted gray;
padding: 5px;
}
th {
background-color: #cc6600;
}
table table th{
background-color: white;
}
.cellcolor {
background-color: #fcba7a;
}
/*
tr:nth-child(2n+1){
background-color: #fcba7a;
}
*/
caption{
font-style: italic;
padding-top: 8px;
}
.center{
text-align:center;
}
.right{
text-align: right;
}
li{
list-style-image: url(images/backpack.gif);
padding-top: 5px;
margin-left: 20px;
}
Word list
- column
- splash
- collapse
- override
- vertical