Getting Started
Welcome to goTableView! This guide will help you install and create your first table in just a few minutes.
What You'll Learn
- How to install goTableView
- System requirements
- Creating your first table
- Understanding the basics
Prerequisites
Before you begin, make sure you have:
- Go 1.18 or higher installed (Download Go)
- Windows OS (Windows 10 or 11 recommended)
- Basic familiarity with Go programming
Why Windows Only?
goTableView uses the native Windows ListView control through direct Windows API calls. This provides excellent performance and a familiar interface, but limits us to Windows platforms.
Installation
Installing goTableView is simple. Open your terminal and run:
go get github.com/mansoldof/goTableViewThis will download the package and its only dependency: golang.org/x/sys/windows.
Verifying Installation
Create a new directory for testing:
mkdir gotableview-test
cd gotableview-test
go mod init example
go get github.com/mansoldof/goTableViewCreate a file named main.go:
package main
import "github.com/mansoldof/goTableView"
func main() {
gotableview.New("Hello goTableView").
Columns("Message").
Row("Installation successful!").
Show()
}Run it:
go run main.goYou should see a window appear with your first table! 🎉

Your First Real Table
Now let's create something more useful. Update your main.go:
package main
import "github.com/mansoldof/goTableView"
func main() {
// Create a table with employee data
gotableview.New("Employee List").
Columns("Name", "Department", "Age", "Salary").
Row("Alice Johnson", "Engineering", "30", "$75,000").
Row("Bob Smith", "Marketing", "25", "$60,000").
Row("Carol White", "Sales", "28", "$65,000").
Row("David Brown", "Engineering", "35", "$85,000").
Show()
}Run it again:
go run main.go
Understanding the Code
Let's break down what's happening:
gotableview.New("Employee List") // Create a new table with a title
.Columns("Name", "Department", "Age", "Salary") // Define column headers
.Row("Alice Johnson", "Engineering", "30", "$75,000") // Add a row
.Row("Bob Smith", "Marketing", "25", "$60,000") // Add another row
.Show() // Display the table windowKey Concepts
- Fluent API: Methods return
*Table, allowing you to chain calls - Title: The window's title bar shows "Employee List"
- Columns: Define headers once with
Columns() - Rows: Add data with
Row(), one call per row - Show: Must be called last to display the window
Common First Steps
Adding Multiple Rows at Once
Instead of calling Row() multiple times, you can use Rows():
data := [][]string{
{"Alice Johnson", "Engineering", "30", "$75,000"},
{"Bob Smith", "Marketing", "25", "$60,000"},
{"Carol White", "Sales", "28", "$65,000"},
}
gotableview.New("Employee List").
Columns("Name", "Department", "Age", "Salary").
Rows(data).
Show()Working with CSV Data
Reading from a CSV file:
package main
import (
"encoding/csv"
"os"
"github.com/mansoldof/goTableView"
)
func main() {
file, _ := os.Open("employees.csv")
defer file.Close()
reader := csv.NewReader(file)
records, _ := reader.ReadAll()
// First row is headers
headers := records[0]
data := records[1:]
gotableview.New("CSV Data").
Columns(headers...).
Rows(data).
Show()
}Troubleshooting
"Package not found" Error
If you see package github.com/mansoldof/goTableView is not in GOROOT, run:
go mod tidy"Cannot find module" Error
Make sure you initialized a Go module:
go mod init your-project-nameWindow Doesn't Appear
- Ensure you're running on Windows
- Check that
Show()is the last method called - Verify no errors in your code
Data Not Displaying
- Make sure column count matches data count in each row
- Check that
Columns()is called beforeRow()orRows()
What's Next?
Now that you have goTableView installed and running, you can:
- Learn about Basic Usage - Different ways to create tables
- Explore Struct Inference - Automatic column detection
- See Examples - Real-world use cases
Need Help?
If you're stuck, check the GitHub Issues or create a new one. We're here to help!