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-collapse to collapse the borders so that there is no border spacing at all.
  • Use the CSS nth-child pseudo-class to add background color to every other row of a table.
  • rowspan colspan
  • 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.
  • .nestedtable
  • list-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

<
Previous Post
0911 Recovering little by little each day
>
Next Post
0912 Learning, reading, sleeping