> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/it/portale/portal-widgets/tables.md).

# Tabelle

Le tabelle possono essere utilizzate per visualizzare i dati agli utenti in un formato a griglia.

## Tabella di base

Le tabelle sono composte da un'origine dati e da una serie di colonne. È possibile utilizzare le variabili PowerShell come origine dati. Uno script semplice potrebbe caricare tutti i servizi presenti sulla macchina in una variabile.

```powershell
$Variables["Services"] = Get-Service
```

La tabella visualizzerebbe quindi un numero definito di proprietà come colonne.

```markup
<Table DataSource="$Services">
    <PropertyColumn Property="Name"></PropertyColumn>
    <PropertyColumn Property="Status"></PropertyColumn>
</Table>
```

## Contenuto delle colonne

Le colonne di proprietà possono fornire contenuti personalizzati in base alla riga visualizzata. Utilizzi la variabile `$Context` per fare riferimento alla riga corrente.

```markup
<Table DataSource="$Services">
    <PropertyColumn Property="Name"></PropertyColumn>
    <PropertyColumn Property="Status">
        <Alert Message="$context.Status" />
    </PropertyColumn>
</Table>
```

## Colonne di azione

Le colonne di azione non sono legate a una proprietà specifica e vengono utilizzate per visualizzare azioni come i pulsanti.

```markup
<Table DataSource="$Services">
    <PropertyColumn Property="Name"></PropertyColumn>
    <PropertyColumn Property="Status">
        <Alert Message="$context.Status" />
    </PropertyColumn>
    <ActionColumn>
        <Button OnClick="ShowStatus">Show Status</Button>
    </ActionColumn>
</Table>
```

Per fare riferimento alla riga corrente nel clic del pulsante, utilizzi il parametro `$Context`.

```powershell
function ShowStatus {
    param($Context)
    $Message.Success($Context.Status.ToString())
}
```


---

# 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://docs.devolutions.net/powershell-universal/it/portale/portal-widgets/tables.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.
