@media screen, print {
  body {
    --table-text-size: var(--font-small);

    --table-add-button-border-width: 0;
    --table-header-border-color: transparent;

    --embed-block-shadow-hover: none;
  }

  body:not(.table-fit-content) table,
  body:not(.table-fit-content) .markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper {
    width: 100%;
  }
  body.table-fit-content .el-table,
  body.table-fit-content .markdown-source-view.mod-cm6 .cm-table-widget {
    display: flex;
    justify-content: center;
  }

  :root table {
    border-collapse: separate;
    border-spacing: 0;
  }

  .markdown-preview-view,
  .cm-sizer {
    table {
      position: relative;
      border-radius: var(--radius-s);
    }

    .table-cell-wrapper:active,
    .table-cell-wrapper:focus,
    .table-cell-wrapper:focus-within {
      background-color: var(--background-modifier-hover);
    }

    tbody {
      background-color: var(--background-primary-alt);
      position: relative;
    }

    thead > th,
    tbody > tr:not(:last-child) > td {
      border-block-end: none;
    }

    thead > th:not(:last-child),
    tbody > tr > td:not(:last-child) {
      border-inline-end: none;
    }

    tbody > tr:first-child > td:first-child,
    tbody > tr:first-child > td:first-child .table-cell-wrapper {
      border-start-start-radius: var(--radius-s);
    }
    tbody > tr:first-child > td:last-child,
    tbody > tr:first-child > td:last-child .table-cell-wrapper {
      border-start-end-radius: var(--radius-s);
    }
    tbody > tr:last-child > td:first-child,
    tbody > tr:last-child > td:first-child .table-cell-wrapper {
      border-end-start-radius: var(--radius-s);
    }
    tbody > tr:last-child > td:last-child,
    tbody > tr:last-child > td:last-child .table-cell-wrapper {
      border-end-end-radius: var(--radius-s);
    }
  }

  .cm-html-embed th,
  .markdown-rendered th,
  .cm-html-embed td,
  .markdown-rendered td,
  .markdown-source-view.mod-cm6 .cm-table-widget .table-cell-wrapper {
    padding: 8px;
  }
  .cm-html-embed th,
  .markdown-rendered th {
    text-align: var(--table-text-align-header);
  }
  .cm-html-embed td,
  .markdown-rendered td {
    text-align: var(--table-text-align-body);
  }

  .dataview,
  .block-language-datacorejsx {
    &.table-view-table {
      &::before {
        border: none;
      }

      tr:first-child > td {
        border-top: none;
      }
    }

    &.table-view-table > thead > tr > th,
    .datacore-table-header-cell {
      border-bottom: none;
      font-weight: var(--table-header-weight);
      font-size: var(--table-header-size);
    }

    &.table-view-table > tbody > tr:not(:only-child) > td {
      max-width: 20em;
    }

    &.dataview-error-box {
      border: none;
      border-radius: var(--radius-s);
      background-color: var(--background-secondary);
      min-height: 80px;
    }

    .dc-paging-control-page {
      padding: 0;
    }
  }
}
