Template:Gallery
|
Usage
[edit]The {{Gallery}} template displays a flexible, auto-wrapped table of images with optional captions, widths, and heights. It supports up to 110 images, each using paired parameters for the file name and its caption.
Each image is rendered via the helper template {{Gallery/aux}}.
Basic syntax
[edit]{{Gallery
|title=Gallery Title (optional)
|1=File:Example1.jpg |2=Caption for image 1
|3=File:Example2.jpg |4=Caption for image 2
|5=File:Example3.jpg |6=Caption for image 3
...
|footer=Optional footer text
}}
Example
[edit]{{Gallery
|title=Sample image gallery
|1=File:Sunset.jpg |2=Sunset over mountains
|3=File:Ocean.jpg |4=Waves crashing on shore
|5=File:Forest.jpg |6=Misty woodland
|footer=All photos are licensed CC-BY-SA.
}}
Parameters
[edit]Global settings
[edit]style=– CSS styling for the outer table. Default:background:transparent; border:1px solid #f0f0f0;align=– Optional alignment of the gallery (e.g.,center,left,right).title=– Optional title displayed above the image grid.footer=– Optional footer displayed below the gallery.width=– Default width (px) for all images. Default: 180.height=– Default height (px) for all images. Default: 180.cellwidth=– Width of each cell. Default: 180.lines=– Number of lines allowed for captions. Default: 2.boxform=– Optional formatting style for image boxes.
Image-specific parameters
[edit]Each image is defined in pairs:
1=,3=, ...,219=– File names (e.g.,File:Example.jpg)2=,4=, ...,220=– Captionsalt1=,alt2=, ...,alt110=– Optional alt text for each imagewidth1=,width2=, ...,width110=– Optional custom width per image
Notes
[edit]- Supports up to 110 images.
- Images are auto-wrapped based on available horizontal space.
- Captions automatically break into multiple lines, controlled by the
lines=parameter. - Custom alt text and per-image widths allow for fine-tuning accessibility and layout.
See also
[edit]- {{Gallery/aux}} – helper used by this template
- {{Gallery}}/sandbox – for testing edits
Template data
[edit]Displays up to 110 images in an auto-wrapping table, each with a caption and customizable dimensions.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Title | title | Optional title displayed above the gallery | String | optional |
| Footer | footer | Optional footer displayed below the gallery | String | optional |
| Style | style | Custom CSS style for the outer table | String | optional |
| Align | align | Alignment of the gallery (left, center, right) | String | optional |
| Default width | width | Default width for images
| Number | optional |
| Default height | height | Default height for images
| Number | optional |
| Cell width | cellwidth | Width of each image cell
| Number | optional |
| Caption lines | lines | Max number of caption lines
| Number | optional |
| Box form | boxform | Optional formatting override for image boxes | String | optional |
