@mixin table-base($p: 0.5rem 1rem) {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;

  th {
    font-weight: bold;
  }

  th,
  td {
    padding: $p;
  }
}

@mixin table-normal($p: 0.5rem 1rem, $border-top: 2px solid #eee, $border: 1px solid #eee) {
  @include table-base($p);
  border-top: $border;

  thead {
    tr {
      th,
      td {
        border: $border;
        border-bottom: $border-top;
      }
    }
  }

  tbody {
    tr {
      &:first-child {
        th,
        td {
          border-top: none;
        }
      }
    }

    th {
      border: $border;
      border-bottom: $border-top;
    }

    td {
      border: $border;
    }
  }
}

@mixin table-line($p: 0.5rem 1rem, $border-top: 2px solid #eee, $border: 1px solid #eee) {
  @include table-base;

  thead {
    tr {
      th,
      td {
        border-bottom: $border-top;
      }
    }
  }

  tr {
    &:first-child {
      th,
      td {
        border-top: none;
      }
    }
  }

  th,
  td {
    border-top: $border;
  }
}

@mixin table-stripe($p: 0.5rem 1rem, $color-thead: #fff, $color-even: #fff, $color-odd: #f8f8f8) {
  @include table-base;

  thead {
    tr {
      background-color: $color-thead;
    }
  }

  tbody {
    tr:nth-child(even) {
      background-color: $color-even;
    }
    tr:nth-child(odd) {
      background-color: $color-odd;
    }
  }
}
