/* Everything about tables */
table {
  width: 100%;
  border-spacing: 0;
  margin: 0rem 0 1rem 0;

  thead tr, tbody tr {
    border-top: $tableBorder;
    transition: $tableTransition;
  }

  tbody tr:last-of-type {
    border-bottom: $tableBorder;
  }

  th {
    text-align: left;
    color: $tableHeaderColor;
    font-weight: normal;
  }

  th, td {
    padding: $tableSpacing;
    &:not(:first-of-type) {
      padding-left: $tableSpacingLastAndFirst;
    }

    &:last-of-type {
      padding-right: $tableSpacingLastAndFirst;
    }
    &:first-of-type {
      padding-left: $tableSpacingLastAndFirst;
    }
  }

  &:not(.no-hover) tbody > tr:hover {
    background: $globalHoverColor;
  }

  // a basic grid for tables
  th, td {
    @include generate-grid();
  }

  &.nowrap {
    th, td {
      @include ellipsis(10px);
    }
  }

  &.plain {
    tr {
      border:none !important;
    }
  }

  &.fixed {
    table-layout:fixed;
  }
  
  &.align-top {
    td {
      vertical-align: top;
    }
  }

}

@media #{$mediaSmall} {
  table.break {
    tr, td, th {
      display:block;
      width:100%;
    }

    th, td {
      padding:$tableSpacingBreak;
    }
  }
}