> 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

Visualizzi i dati nei widget del portale PowerShell Universal utilizzando il componente Table, incluse le colonne con contenuto personalizzato e le colonne con pulsanti di azione.

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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/powershell-universal/it/portale/portal-widgets/tables.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
