Are you an LLM? You can read better optimized documentation at /front/component/ma-table/basic.md for this page in Markdown format
Basic Table β
Demonstrates the most fundamental table functionalities, including striping, borders, highlighting the current row, and other features.
Basic Usage β
Feature Description β
Basic Configuration β
- Striped Rows:
stripe: true
enables alternating row colors - Borders:
border: true
displays table borders - Current Row Highlight:
highlightCurrentRow: true
highlights the clicked row - Header Visibility:
showHeader: true
controls header display
Column Configuration β
- Fixed Width:
width
sets a fixed column width - Minimum Width:
minWidth
sets the minimum column width - Alignment:
align
controls content alignment within columns
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: 'Tech', 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 display striped rows | boolean | false |
border | Whether to show 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 header | boolean | true |