Horizontal containers in Tableau allow you to arrange multiple worksheets, dashboards, or other objects side-by-side, ensuring they maintain their relative positions and distribute space effectively as your dashboard size changes.
Layout containers are fundamental to creating organized and responsive Tableau dashboards. They act as invisible frames that hold and manage the positioning of various dashboard elements, such as worksheets, text objects, images, and legends. A horizontal container specifically arranges items in a row, distributing available space among them from left to right. This is crucial for dashboards that need to scale gracefully across different screen sizes, providing a consistent user experience.
Steps to Use Horizontal Containers
Using a horizontal container involves a straightforward drag-and-drop process to structure your dashboard elements.
-
Add a Horizontal Container to Your Dashboard
- Navigate to the Dashboard pane in Tableau Desktop.
- In the Objects section (typically on the left panel), locate the Horizontal container object.
- Click and drag the Horizontal container from the Objects list onto your dashboard canvas. You'll see a light blue shaded area indicating where it will be placed.
- For most responsive and structured dashboard designs, it's recommended to add it as a "Tiled" object (the default behavior) rather than "Floating."
-
Add Items into the Container
- Once the horizontal container is on your dashboard, you can click and drag worksheets, text objects, images, or other dashboard items directly into it.
- As you drag an item, Tableau will highlight the container, showing you where the item will be placed. You'll see a distinct shaded area appear within the container, indicating the insertion point (to the left, to the right, or between existing items).
- Continue to click and drag additional objects into the same horizontal container. Each new object will be placed next to the previous one, arranging them horizontally.
-
Distribute and Resize Items
- By default, Tableau attempts to distribute space evenly among items within a container.
- To manually adjust the width of individual items, select an item within the container, click the dropdown arrow that appears, and choose Edit Width.
- For automatic and equal distribution, select the container itself (you can often do this by clicking on an item inside it, then clicking the outer container handle). From the container's dropdown menu (the small arrow at the top right of the container), select Distribute Contents Evenly. This will ensure all contained items take up an equal proportion of the container's width.
- Tableau intelligently adjusts the spacing if there's plenty of room, and often there's no particular height constraint imposed by the container itself, allowing the contained worksheets to adapt their height based on their content, as long as the dashboard's overall height permits.
Benefits of Horizontal Containers
Incorporating horizontal containers into your dashboard design offers several significant advantages:
- Responsive Design: Ensures your dashboard elements adapt gracefully to different screen resolutions, maintaining their relative positions and proportions.
- Organized Layout: Helps in structuring your dashboard logically, grouping related visualizations or elements side-by-side.
- Efficient Space Usage: Prevents overlapping content and makes optimal use of your dashboard's available real estate.
- Easier Management: Move, resize, or hide a group of objects simply by manipulating their parent container, rather than adjusting each item individually.
- Consistent Aesthetics: Maintains uniform spacing and alignment, contributing to a professional and polished dashboard appearance.
Practical Tips and Best Practices
To maximize the effectiveness of horizontal containers, consider these best practices:
- Tiled vs. Floating: For responsive and organized layouts, always prefer Tiled containers. Floating containers offer precise pixel control but sacrifice responsiveness and can make dashboard maintenance more complex.
- Nested Containers: You can nest containers (e.g., a vertical container inside a horizontal one, or vice-versa) to create complex yet structured layouts. This is a powerful technique for building sophisticated and adaptable dashboard designs.
- Show/Hide Buttons: Combine containers with show/hide buttons to create dynamic dashboard elements, allowing users to toggle the visibility of certain sections or details.
- Borders and Shading: Apply borders or background shading to containers (not just individual items) to visually group elements and enhance dashboard clarity and separation.
- Blank Objects: Utilize Blank objects from the Objects pane within containers to create additional spacing or padding between items. Drag a blank object into the container and adjust its width as needed to fine-tune spacing.
- Selecting Containers: It can sometimes be challenging to select the container itself rather than an item inside it. Click on an item within the container, then hover over its border until you see a thicker border for the container, or use the Layout pane on the left to select the desired container from the hierarchy.
Example: Arranging Dashboard Elements with a Horizontal Container
Container Item | Purpose | Example Content |
---|---|---|
Left Controls | Filters, parameters, and legends | Quick Filters, Date Range Parameter, Color Legend |
Primary Viz | Main visualization for detailed analysis | Sales Trend Line Chart with Forecast |
Secondary Viz | Supporting visualization or key performance indicator | Regional Sales Map or Top N Customers Bar Chart |
In this setup, a single horizontal container could hold all three items, ensuring they resize proportionally and maintain their side-by-side arrangement across different screen sizes.