//
// Tables
// --------------------------------------------------


table {
  max-width: 100%;
  background-color: @table-bg;
}

th {
  text-align: left;
}


// Baseline styles

table {
  width: 100%;
  margin-bottom: @line-height-computed;
  border: none;

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

  > tbody > tr:last-child > td {
  	border-bottom-width: 1px;
  }

  // Heading Style
  > thead > tr > th {
    background: #f2f2f2;
  }

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

  // TFoot style
  > tfoot > tr > td {
  	border-bottom-width: 1px;
  }

  // Nesting
  table {
    background-color: @body-bg;
  }

}

// Condensed table w/ half padding

.table-condensed {
  > thead,
  > tbody,
  > tfoot {
    > tr {
      > th,
      > td {
        padding: @table-condensed-cell-padding;
      }
    }
  }
}

// Responsive tables
//
// Wrap your tables in `.table-responsive` and we'll make them mobile friendly
// by enabling horizontal scrolling. Only applies <768px. Everything above that
// will display normally.

@media (max-width: @screen-xs-max) {
  .table-responsive {
    width: 100%;
    margin-bottom: (@line-height-computed * 0.75);
    overflow-y: hidden;
    overflow-x: scroll;
    -ms-overflow-style: -ms-autohiding-scrollbar;
    border: 1px solid @table-border-color;
    -webkit-overflow-scrolling: touch;

    // Tighten up spacing
    > .table {
      margin-bottom: 0;

      // Ensure the content doesn't wrap
      > thead,
      > tbody,
      > tfoot {
        > tr {
          > th,
          > td {
            white-space: nowrap;
          }
        }
      }
    }
  }
}
