---
Product: Aspose.Slides
Platform: java
Page Type: reference
Canonical URL: https://reference.aspose.org/slides/java/ColumnCollection
---

# ColumnCollection

## Overview

`ColumnCollection` is a class in Aspose.Slides FOSS for Java.
Inherits from: `IColumnCollection`, `Iterable`.

Represents collection of columns in a table.

This class provides 15 methods for working with ColumnCollection objects in Java programs.
Available methods include: `ColumnCollection`, `addClone`, `asICollection`, `asIEnumerable`, `asList`, `get`, `initInternal`, `insertClone`, `iterator`, `makeEmptyTc`, `rebuild`, `removeAt`, and 1 additional methods.
All public members are accessible to any Java application after installing the Aspose.Slides FOSS for Java package.

## Methods

| Signature | Description |
|-----------|-------------|
| `ColumnCollection(tblElement: Element, tblGridElement: Element, saveCallback: Runnable)` | Creates a new ColumnCollection backed by XML elements. |
| `ColumnCollection(columns: List)` | Creates a new ColumnCollection with the given columns (no XML backing). |
| `ColumnCollection()` | Creates an empty ColumnCollection (no XML backing). |
| `initInternal(tblElement: Element, tblGridElement: Element, saveCallback: Runnable)` → `ColumnCollection` | Initializes this collection with the given XML elements and context. |
| `rebuild()` | Rebuilds the column list from the XML grid elements. |
| `get(index: int)` → `IColumn` | Returns the IColumn at the specified index |
| `size()` → `int` | Returns the number of columns in the collection |
| `addClone(templ: IColumn, withAttachedColumns: boolean)` → `List` | Creates clones of the template column, optionally with attached columns, and returns them |
| `insertClone(index: int, templ: IColumn, withAttachedColumns: boolean)` → `List` | Inserts cloned columns at the given index, optionally with attached columns, and returns them |
| `removeAt(firstColumnIndex: int, withAttachedRows: boolean)` | Removes columns starting at the specified index, optionally also removing attached rows |
| `asICollection()` → `List` | Returns the columns as a List collection |
| `asIEnumerable()` → `Iterable` | Returns the columns as an Iterable sequence |
| `asList()` → `List` | Returns an unmodifiable view of the internal column list. |
| `iterator()` → `Iterator` | Returns an iterator over the IColumn elements in the collection |
| `makeEmptyTc(doc: Document)` → `Element` | Creates an empty {@code } element with txBody and tcPr. |

## See Also

- [Aspose.Slides — Enterprise API Reference](https://reference.aspose.com/slides/)