//
// Tables
// ==================================================


table
{
  max-width: 100%;
  background-color: @table-bg;
}
th
{
  text-align: left;
}


// Types
// --------------------------------------------------

// default

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

  // Cells
  th,
  td
  {
    padding: @table-cell-padding;
    line-height: @line-height-base;
    vertical-align: top;
    border-bottom: 1px solid @table-border-color;
    // border-top: 1px solid lighten(@table-border-color, 5%);

    .transition(all,@animation-speed-fast,@animation-type);
  }

  // Bottom align for column headings
  > thead > tr > th
  {
    vertical-align: bottom;
    border-bottom: 1px solid @table-border-color;
    background-color: @table-head-bg;
  }
}

// Table with fixed layout

.table-fixed
{
  table-layout: fixed;

  th, td
  {
    overflow:hidden;
    white-space:nowrap;
  }

  tfoot > tr > th,
  tfoot > tr > td,
  th.nofixed,
  td.nofixed{overflow: visible;}
}

// Table without border

.table-borderless
{
  th,
  td
  {
    border: none;
  }
}

// Condensed table w/ half padding

.table-condensed
{
  th,
  td
  {
    padding: @table-condensed-cell-padding;
  }
}

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

.table-bordered
{
  border: 1px solid @table-border-color;
  th,
  td
  {
    border: 1px solid @table-border-color;
  }
}


// Zebra-striping
//
// Default zebra-stripe styles (alternating gray and transparent backgrounds)

.table-striped > tbody > tr:nth-child(odd)
{
  > td,
  > th
  {
    background-color: @table-bg-accent;
  }
}


// Hover effect
//
// Placed here since it has to come after the potential zebra striping

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

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

table col[class*="col-"]
{
  float: none;
  display: table-column;
}
table
{
  td,
  th
  {
    &[class*="col-"]
    {
      float: none;
      display: table-cell;
    }
  }
}

// Table backgrounds
//
// Exact selectors below required to override `.table-striped` and prevent
// inheritance to nested tables.

.table tr
{
  > td.active,
  > th.active,
  &.active > td,
  &.active > th
  {
    background-color: @table-bg-active;
  }
}
