TableView
is a custom class that implements a table view to display data as a table. It is similar to the built-in Tree
class.
Important
Only Godot 4.4+ is supported. This add-on is still in development and needs testing!
- Column sorting capabilities
- Filter rows with a custom Callable method
- In-place cell value editing
git clone
this repository toaddons
folder.- Enable
Table View
in Plugins. - Done!
A TableView
does not provide a built-in user interface for managing columns and rows. Instead, all control and customization must be done programmatically through code.
First, I recommend checking out the test scene in the repository.
Add TableView
as a child node to the scene.
# Declare a `TableView` in a parent node.
@onready var table_view: TableView = $TableView
# The `add_column` method returns the index of the newly created column.
# The first argument defines the column title, and the second defines its data type.
var name = table_view.add_column("Name", TableView.Type.STRING)
var unique = table_view.add_column("Unique", TableView.Type.BOOL)
# The third argument defines the hint type.
var cost = table_view.add_column("Cost", TableView.Type.INT, TableView.Hint.hint_range(0, 1000))
for item: Dictionary in get_items(): # Returns an array of dictionaries.
# Adds a new row and returns the index of the newly created row.
var row = table_view.add_row()
# Previously declared variables are passed as the column index argument.
table_view.set_cell_value(row, name, item.name)
table_view.set_cell_value(row, unique, item.unique)
table_view.set_cell_value(row, cost, item.cost)
Because I can.
Copyright (c) 2024-2025 Mansur Isaev and contributors
Unless otherwise specified, files in this repository are licensed under the MIT license. See LICENSE.md for more information.