// Tables

table.table {
  width: 100%;
  margin-bottom: $baseLineHeight;
  padding: 0;
  border-collapse: separate; // Done so we can round those corners!
  font-size: $baseFontSize;
  border: 1px solid #ddd;
  @include border-radius(4px);
  th, td {
    padding: 10px 10px 9px;
    line-height: $baseLineHeight;
    @include text-align-left($rtl);
  }
  th {
    background: $tablesHeadBackground;
    padding-top: 9px;
    font-weight: bold;
    vertical-align: middle;
  }
  thead th {
    border-bottom: 1px solid #ddd;
  }
  td {
    background: $tablesBodyBackground;
    vertical-align: top;
  }
  th + th,
  th + td,
  td + td {
    @if $rtl == false { @mixin border($rtl){ border-left: 1px solid #ddd; }}
    @if $rtl == true { @mixin border($rtl){ border-right: 1px solid #ddd; }}
    @include border($rtl);
  }
  tr + tr th, tr + tr td {
    border-top: 1px solid #ddd;
  }
  thead tr:first-child th:first-child {
    @include border-radius-topleft(3px);
  }
  thead tr:first-child th:last-child {
    @include border-radius-topright(3px);
  }
  tbody tr:last-child td:first-child {
    @include border-radius-bottomleft(3px);
  }
  tbody tr:last-child td:last-child {
    @include border-radius-bottomright(3px);
  }
}


// Zebra striping

// Default zebra-stripe styles (alternating gray and transparent backgrounds)
table.zebra {
  tbody {
    tr:nth-child(odd) td {
      background-color: mix(#ffffff, $blueSoft, 95%);
    }
  }
}

table.table {
  // Tablesorting styles w/ jQuery plugin
  .header {
    cursor: pointer;
    &:after {
      content: "";
      float: right;
      margin-top: 7px;
      border-width: 0 4px 4px;
      border-style: solid;
      border-color: #000 transparent;
      visibility: hidden;
    }
  }
  // Style the sorted column headers (THs)
  .headerSortUp,
  .headerSortDown {
    background-color: rgba(141,192,219,.25);
    text-shadow: 0 1px 1px rgba(255,255,255,.75);
  }
  // Style the ascending (reverse alphabetical) column header
  .header:hover {
    &:after {
      visibility:visible;
    }
  }
  // Style the descending (alphabetical) column header
  .headerSortDown,
  .headerSortDown:hover {
    &:after {
      visibility:visible;
      opacity: .6;
    }
  }
  // Style the ascending (reverse alphabetical) column header
  .headerSortUp {
    &:after {
      border-bottom: none;
      border-left: 4px solid transparent;
      border-right: 4px solid transparent;
      border-top: 4px solid #000;
      visibility:visible;
      opacity: .6;
    }
  }
}

table.table-text {
  border: none;

  thead {
    th {
      border: none;
      border-bottom: 3px solid $borderColor;
    }
  }

  td + td {
    border: none;
  }

  tr + tr td {
    border-top: 1px dotted #ddd;
  }
}

table.table-hover {
  tbody {
    tr:hover {
      > td, > th {
        background-color: $panelBackground;
      }
    }
  }
}
