> 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/fr/portail/portal-widgets/tables.md).

# Tableaux

Les tableaux peuvent être utilisés pour afficher des données aux utilisateurs dans un format de grille.

## Tableau de base

Les tableaux sont constitués d'une source de données et d'une série de colonnes. Vous pouvez utiliser des variables PowerShell comme source de données. Un script simple pourrait charger tous les services de la machine dans une variable.

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

Le tableau afficherait ensuite un nombre défini de propriétés sous forme de colonnes.

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

## Contenu des colonnes

Les colonnes de propriétés peuvent fournir un contenu personnalisé en fonction de la ligne en cours de rendu. Utilisez la variable `$Context` pour référencer la ligne actuelle.

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

## Colonnes d'actions

Les colonnes d'actions ne sont pas liées à une propriété particulière et sont utilisées pour afficher des actions telles que des boutons.

```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>
```

Pour référencer la ligne actuelle lors du clic sur le bouton, utilisez le paramètre `$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:

```
GET https://docs.devolutions.net/powershell-universal/fr/portail/portal-widgets/tables.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
