> For the complete documentation index, see [llms.txt](https://matanya.gitbook.io/vue-tables-2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://matanya.gitbook.io/vue-tables-2/client-table/grouping.md).

# Grouping

The client component supports simple grouping of rows by a common value. By simple we mean that the grouping is merely *presentational*, and not backed by a real model-level data grouping (i.e the data is NOT divided into distinct arrays). you can group by any property on your dataset. For example, for a table of countries you can group by a \`continent\` property. Simply declare in your options `groupBy:'continent'`.

If you want to present some additional meta-data realted to each value, you can use the \`groupMeta\` option, along with the dedicated `__group_meta` scoped slot. For example:

```javascript
{
    groupBy:'continent',
    groupMeta:[
       {
           value:'Africa',
           data:{
               population:1216,
               countries:54
           }
       },
       {
           value:'Asia',
           data:{
               population:4436
               countries:48
           }
       },
       {
           value:'Europe',
           data:{
               population:741.4,
               countries:50
           }
       }
       // etc...
    ]
    }
```

```markup
<span slot="__group_meta" slot-scope="{ value, data }">
  {value} has {data.countries} countries and a population of {data.population} million
</span>
```

### Multiple Level Grouping

{% hint style="info" %}
This feature is only available on vue-tables-2-premium and v-tables-3
{% endhint %}

To employ *data-level* *nested grouping,* pass an array to `groupBy,` e.g `groupBy: ['country','city'] and you're good to go. The filteredData` computed property will reflect the nested presentation.

![](/files/-M5AhCs-ZgbZVMjLaRHB)

{% hint style="info" %}
use the `` VueTables__group-row--{level}` ``classes to apply background and padding to group rows
{% endhint %}

&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://matanya.gitbook.io/vue-tables-2/client-table/grouping.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
