table { background-color: $table-bg; }
table th { text-align: left }

// Baseline styles

.table {
  width: 100%;
  max-width: 100%;
  margin-bottom: $line-height-computed;

  // Cells
  > thead > tr > th,
  > thead > tr > td,
  > tbody > tr > th,
  > tbody > tr > td,
  > tfoot > tr > th,
  > tfoot > tr > td {
    padding: $table-cell-padding;
    line-height: $line-height-base;
    vertical-align: top;
    border-top: 1px solid $table-border-color;
  }

  // Bottom align for column headings
  > thead > tr > th {
    vertical-align: bottom;
    border-bottom: 2px solid $table-border-color;
  }

  // Remove top border from thead by default
  > caption + thead,
  > colgroup + thead,
  > thead:first-child > tr:first-child > th > td {
    border-top: 0;
  }

  // Account for multiple tbody instances
  > tbody + tbody { border-top: 2px solid $table-border-color; }

  // Condensed table w/ half padding
  &.table--condensed > thead > tbody > tfoot > tr > th,
  &.table--condensed > thead > tbody > tfoot > tr > td {
    padding: ($table-cell-padding / 2);
  }

// Bordered version
// Add borders all around the table and between all the columns.

  &.table--bordered {
    border: 1px solid $table-border-color;
    
    > thead > tr > th,
    > thead > tr > td,
    > tbody > tr > th,
    > tbody > tr > td,
    > tfoot > tr > th,
    > tfoot > tr > td {
      border: 1px solid $table-border-color;
    }

    > thead > tr > th,
    > thead > tr > td {
      border-bottom-width: 2px;
    }
  }

  // Zebra-striping
  // Default zebra-stripe styles (alternating gray and transparent backgrounds)
  &.table--striped > tbody > tr:nth-of-type(odd) { background-color: $table-bg-accent; }

  // Hover effect
  // Placed here since it has to come after the potential zebra striping
  &.-hover > tbody > tr:hover { background-color: $table-bg-hover; }
}

// Table cell sizing
//
// Reset default table behavior

table col[class*="col-"] {
  // Prevent border hiding in Firefox and IE9-11
  // (see https//github.com/twbs/bootstrap/issues/11623)
  position: static;
  float: none;
  display: table-column;
}

table td [class*="col-"],
table th [class*="col-"] {
  // Prevent border hiding in Firefox and IE9-11
  // (see https//github.com/twbs/bootstrap/issues/11623)
  position: static;
  float: none;
  display: table-cell;
}
