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

# Tableaux

Affichez des données dans les widgets du portail PowerShell Universal à l'aide du composant Table, y compris le contenu de colonnes personnalisé et les colonnes de boutons d'action.

Les tables peuvent être utilisées pour afficher des données aux utilisateurs sous forme de grille.

## Table de base

Les tables sont constituées 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
```

La table 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 du contenu personnalisé en fonction de la ligne affichée. 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'action

Les colonnes d'action ne sont pas liées à une propriété particulière et servent à 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 dans le clic du 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 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/fr/portal/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.
