/* cf. http://www.w3.org/TR/html5/rendering.html#the-css-user-agent-style-sheet-and-presentational-hints */

table, td, th { border-color: gray; }
thead, tbody, tfoot, tr { border-color: inherit; }

thead[valign=top i], tbody[valign=top i], tfoot[valign=top i],
tr[valign=top i], td[valign=top i], th[valign=top i] {
  vertical-align: top;
}
thead[valign=middle i], tbody[valign=middle i], tfoot[valign=middle i],
tr[valign=middle i], td[valign=middle i], th[valign=middle i] {
  vertical-align: middle;
}
thead[valign=bottom i], tbody[valign=bottom i], tfoot[valign=bottom i],
tr[valign=bottom i], td[valign=bottom i], th[valign=bottom i] {
  vertical-align: bottom;
}
thead[valign=baseline i], tbody[valign=baseline i], tfoot[valign=baseline i],
tr[valign=baseline i], td[valign=baseline i], th[valign=baseline i] {
  vertical-align: baseline;
}

td[nowrap], th[nowrap] { white-space: nowrap; }

table[border] {
  /* only if border is not equivalent to zero */
  border-style: outset;
}

table[border] > tr > td, table[border] > tr > th,
table[border] > thead > tr > td, table[border] > thead > tr > th,
table[border] > tbody > tr > td, table[border] > tbody > tr > th,
table[border] > tfoot > tr > td, table[border] > tfoot > tr > th {
  /* only if border is not equivalent to zero */
  border-width: 1px;
  border-style: inset;
}

table[border='0'] { border-style: none; }

table[border='0'] > tr > td, table[border='0'] > tr > th,
table[border='0'] > thead > tr > td, table[border='0'] > thead > tr > th,
table[border='0'] > tbody > tr > td, table[border='0'] > tbody > tr > th,
table[border='0'] > tfoot > tr > td, table[border='0'] > tfoot > tr > th {
  border-style: none;
}
