Border Class Overview
TheBorder class manages all border characters for your table, including corners, lines, and connectors.
Pre-defined Border Styles
Tabular provides several built-in border styles for quick customization.Modern (Default)
Clean, modern Unicode box-drawing characters:- Horizontal:
─(U+2500) - Vertical:
│(U+2502) - Corners:
┌┐└┘ - Connectors:
├┤┬┴ - Intersection:
┼
Rounded
Softer appearance with rounded corners:- Horizontal:
─(U+2500) - Vertical:
│(U+2502) - Corners:
╭╮╰╯ - Connectors:
├┤┬┴ - Intersection:
┼
Heavy
Bold, heavy lines for emphasis:- Horizontal:
━(U+2501) - Vertical:
┃(U+2503) - Corners:
┏┓┗┛ - Connectors:
┣┫┳┻ - Intersection:
╋
Double
Double-line borders:- Horizontal:
═(U+2550) - Vertical:
║(U+2551) - Corners:
╔╗╚╝ - Connectors:
╠╣╦╩ - Intersection:
╬
ASCII Borders
For terminals that don’t support Unicode, the default ASCII border is used:- Horizontal:
- - Vertical:
| - Corners and connectors:
+
Other Border Styles
Custom Border Parts
You can customize individual border components for complete control.Border Components
A border consists of 11 different parts:| Part | Description | Position |
|---|---|---|
horizontal() | Top and bottom lines | ───── |
vertical() | Left and right lines | │ |
cornerTopLeft() | Top-left corner | ┌ |
cornerTopRight() | Top-right corner | ┐ |
cornerBottomLeft() | Bottom-left corner | └ |
cornerBottomRight() | Bottom-right corner | ┘ |
connectorTop() | Column separator (top) | ┬ |
connectorBottom() | Column separator (bottom) | ┴ |
connectorLeft() | Row separator (left) | ├ |
connectorRight() | Row separator (right) | ┤ |
intersection() | Cross intersection | ┼ |
Setting Border Characters
There are two ways to set border characters:Custom Border Example
Border Coloring
Each border part can be individually colored using foreground and background colors.Setting Border Colors
Complete Colored Border Example
Clearing Border Colors
Resetting Borders
Reset the border to default ASCII style:Border colors support both terminal colors (like
Color::Red) and RGB values (like Rgb{255, 0, 0}). RGB colors may not be supported in all terminal emulators.