body {
  --table-header-color: var(--text-on-accent);
  --table-header-background-hover: var(--ebw-table-header-alt);
  --table-row-background-hover: var(--ebw-row-alt-hover);
  --table-row-alt-background-hover: var(--ebw-row-alt-hover);
  --table-background: var(--ebw-row-alt);
  --table-row-alt-background: unset;
  --table-column-alt-background: unset;
  --table-header-size: var(--font-small);
}
.theme-dark {
  --table-header-color: var(--text-on-accent);
  --table-header-background: var(--primary-accent-5);
  --ebw-table-header-alt: var(--primary-accent-4);
  --ebw-row-alt: rgba(0, 0, 0, .2);
  --ebw-row-alt-hover: rgba(var(--primary-accent-4-rgb), .2);
}
.theme-light {
  --table-header-color: var(--gray-dark-7);
  --table-header-background: var(--primary-accent-1);
  --table-header-border-color: var(--primary-accent-3);
  --table-header-weight: var(--font-semibold);
  --ebw-table-header-alt: rgba(var(--primary-accent-4-rgb), .4);
  --ebw-row-alt: rgba(0, 0, 0, .05);
  --ebw-row-alt-hover: rgba(var(--primary-accent-4-rgb), .05);
}
.markdown-rendered table.table-view-table.dataview {
  > thead {
    > tr > th,
    > tr > th.table-view-th {
      border: var(--table-border-width) solid var(--table-border-color);
      border-width: var(--table-header-border-width);
      border-color: var(--table-header-border-color);

      font-size: var(--table-header-size);
      font-weight: var(--table-header-weight);

      max-width: var(--table-column-max-width);

      .dataview.small-text {
        color: var(--text-on-accent);
        font-weight: 200;
      }
    }
    > tr > th:first-child {
      border-left-width: var(--table-column-first-border-width);
    }
    > tr > th:last-child {
      border-right-width: var(--table-column-last-border-width);
    }
  }
  > tbody {
    > tr:hover {
      background-color: var(--table-row-background-hover);
    }
  }
  tr > td {
    border: var(--table-border-width) solid var(--table-border-color);
    max-width: var(--table-column-max-width);
  }
  tr:last-child > td {
    border-bottom-width: var(--table-row-last-border-width);
  }
  tr > td:first-child {
    border-left-width: var(--table-column-first-border-width);
  }
  tr > td:last-child {
    border-right-width: var(--table-column-last-border-width);
  }
}

.markdown-rendered.force-wrap {
  table,
  table.table-view-table,
  table.table-view-table.dataview {
    max-width: 100%;

    .table-view-table > thead,
    thead {
      max-width: 100%;
    }
    .table-view-table > tbody,
    tbody {
      max-width: 100%;

      > tr > td {
        word-break: break-all;
      }
    }
  }
}

.markdown-rendered.word-wrap {
  table,
  table.table-view-table,
  table.table-view-table.dataview {

    .table-view-table > thead > tr > th,
    thead > th {
      white-space: pre;
    }

    .table-view-table > tbody > tr > td ,
    tbody > tr > td {
      word-wrap: normal;
      word-break: normal;
    }
  }
}


