AdaptTable for Element Plus

Mobile cards in Element Plus

Below the mobile breakpoint every row becomes a card — same columns, same row content, same query state. Use Automatic, Phone cards or Scrollable table to compare the same data without remounting.

Per column, mobileLabel and hideOnMobile tune what a card shows, and on a phone the pager gives way to infinite scroll: the next rows load as the list reaches its end. There is no second layout to build.

The code

<script setup lang="ts">
import type { ColumnDef } from "@adapttable/vue";
import { DataTable } from "@adapttable/element-plus";

defineProps<{ rows: readonly Person[] }>();

const columns: ColumnDef<Person>[] = [
  { key: "name", mobileLabel: "" },
  { key: "team", mobileLabel: "Team" },
  { key: "email", hideOnMobile: true },
];
const rowKey = (row: Person) => row.id;
</script>

<template>
  <DataTable :data="rows" :columns="columns" :row-key="rowKey" />
</template>

Install

pnpm add @adapttable/element-plus @adapttable/vue @adapttable/core element-plus

The same feature in the other kits

More Element Plus features

Reference: mobile. More of this kit: AdaptTable for Element Plus, or the live demo.