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

# Tablas

Muestre datos en los widgets del portal de PowerShell Universal mediante el componente Table, incluidos el contenido de columnas personalizado y las columnas con botones de acción.

Las tablas pueden utilizarse para mostrar datos a los usuarios en formato de cuadrícula.

## Tabla básica

Las tablas constan de una fuente de datos y una serie de columnas. Puede usar variables de PowerShell como fuente de datos. Un script sencillo podría cargar todos los servicios de la máquina en una variable.

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

La tabla mostraría entonces un número determinado de propiedades como columnas.

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

## Contenido de las columnas

Las columnas de propiedades pueden proporcionar contenido personalizado en función de la fila que se esté representando. Utilice la variable `$Context` para hacer referencia a la fila actual.

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

## Columnas de acciones

Las columnas de acciones no están vinculadas a una propiedad concreta y se utilizan para mostrar acciones como botones.

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

Para hacer referencia a la fila actual en el clic del botón, utilice el parámetro `$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/es/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.
