Are you an LLM? You can read better optimized documentation at /v3/front/component/ma-table/basic.md for this page in Markdown format
Basic Table โ
Demonstrates the most fundamental table functionality, including features such as striping, borders, and highlighting the current row.
Basic Usage โ
Feature Description โ
Basic Configuration โ
- Striped Display:
stripe: trueenables alternating row colors - Border Display:
border: trueshows table borders - Current Row Highlighting:
highlightCurrentRow: truehighlights a row when clicked - Header Display:
showHeader: truecontrols the visibility of the table header
Column Configuration โ
- Fixed Width:
widthsets a fixed width for the column - Minimum Width:
minWidthsets the minimum width for the column - Column Alignment:
aligncontrols the text alignment within the column
Code Example โ
vue
<template>
<ma-table
:columns="columns"
:data="data"
:options="options"
/>
</template>
<script setup>
import { ref } from 'vue'
const columns = ref([
{ label: 'Name', prop: 'name', width: 120 },
{ label: 'Age', prop: 'age', width: 80 },
{ label: 'Email', prop: 'email' },
{ label: 'Department', prop: 'department' },
{ label: 'Position', prop: 'position' }
])
const options = ref({
stripe: true,
border: true,
size: 'default',
showHeader: true,
highlightCurrentRow: true
})
const data = [
{ name: 'Zhang San', age: 28, email: 'zhangsan@example.com', department: 'Technology', position: 'Frontend Engineer' },
// ... more data
]
</script>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Configuration Parameters โ
| Parameter | Description | Type | Default |
|---|---|---|---|
stripe | Whether to use alternating row colors | boolean | false |
border | Whether to display vertical borders | boolean | false |
size | Table size | 'large' | 'default' | 'small' | 'default' |
highlightCurrentRow | Whether to highlight the current row | boolean | false |
showHeader | Whether to display the table header | boolean | true |