# Expanding component to fit screen/container

{% hint style="success" %}
Here, we talk about [Table](/reference/working-with-components/table.md) and [Card](/reference/working-with-components/card.md) components.
{% endhint %}

You may have cases when you need your components to take up all the available width and height of the page regardless of the user's screen size, for example, to avoid getting a scroll bar. In such cases, you can use our **Expand content to fit** feature. Let's explore it in more details.

## Scenario 1 (single component on the page)

Let's say you have added a *Table* to your page and you want it to occupy all the available space. You simply need to select the **Expand content to fit** checkbox in page settings in the right side panel.

<figure><img src="/files/CM02KpFCGEZssNmeMjKG" alt=""><figcaption></figcaption></figure>

## Scenario 2 (several components on the page)

Now, let's say you've also added a *Button* to the page, for example, and now you want both Table and Button to occupy all available space. If you try selecting the **Expand content to fit** checkbox now, you'll notice that it's *disabled*.&#x20;

This is because the feature is designed to ensure that a **single** **child** component can stretch to fully occupy its parent container’s available space.

{% hint style="warning" %}
When **multiple** **child** components are present, the layout must accommodate all of them, making it impossible for one element to expand to 100% without conflicting with the others.
{% endhint %}

In such cases, you need to add a **Card** component to the page and put your components inside the Card.&#x20;

### To use components inside the Card:

1. First, select the **Expand content to fit** checkbox in page settings in the right side panel.
2. Next, drag and drop a **Card** component into your working area.&#x20;
3. Now, select the *Expand content to fit* checkbox for the Card as well.
4. Then, drop a **Table** component to the Card body - it should occupy all available space.
5. Add other components you need to the Card header, for example, *Text input -* to add some filters.
6. Additionally, for the Card, you can also **Disable container styles** and set a **transparent** background.\
   The final result will look like your components are not placed inside any additional container.

That's it! Now you get a page that looks excellent on every screen size and is not limited to single component only.

{% @arcade/embed flowId="eXGuk4LpXSgXIXTkJkTA" url="<https://app.arcade.software/share/eXGuk4LpXSgXIXTkJkTA>" %}

## Expand content to fit & Height = Auto combination

Let's say you've added a *Frame Drawer* component and put a Table inside it - you want the table to occupy all available space and have vertical scroll applied within its body. For this purpose, you may try setting the Table's **Height** setting to *Auto*.\
\
:exclamation:However, this combination will result in a <mark style="color:red;">conflict</mark> and vertical scroll in the table won't work. You'll just have to leave the Height setting at **Fixed** to avoid this issue.&#x20;

<figure><img src="/files/fFt8jdFWMtrfOSMvvUjk" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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.uibakery.io/concepts/components/work-with-components/expand-component-to-fill-screen-container.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.
