MCPcopy
hub / github.com/rivo/tview / Table

Struct Table

table.go:463–535  ·  view source on GitHub ↗

Table visualizes two-dimensional data consisting of rows and columns. Each Table cell is defined via [Table.SetCell] by the [TableCell] type. They can be added dynamically to the table and changed any time. The most compact display of a table is without borders. Each row will then occupy one row on

Source from the content-addressed store, hash-verified

461//
462// See https://github.com/rivo/tview/wiki/Table for an example.
463type Table struct {
464 *Box
465
466 // Whether or not this table has borders around each cell.
467 borders bool
468
469 // The color of the borders or the separator.
470 bordersColor tcell.Color
471
472 // If there are no borders, the column separator.
473 separator rune
474
475 // The table's data structure.
476 content TableContent
477
478 // If true, when calculating the widths of the columns, all rows are evaluated
479 // instead of only the visible ones.
480 evaluateAllRows bool
481
482 // The number of fixed rows / columns.
483 fixedRows, fixedColumns int
484
485 // Whether or not rows or columns can be selected. If both are set to true,
486 // cells can be selected.
487 rowsSelectable, columnsSelectable bool
488
489 // The currently selected row and column.
490 selectedRow, selectedColumn int
491
492 // A temporary flag which causes the next call to Draw() to force the
493 // current selection to remain visible. It is set to false afterwards.
494 clampToSelection bool
495
496 // If set to true, moving the selection will wrap around horizontally (last
497 // to first column and vice versa) or vertically (last to first row and vice
498 // versa).
499 wrapHorizontally, wrapVertically bool
500
501 // The number of rows/columns by which the table is scrolled down/to the
502 // right.
503 rowOffset, columnOffset int
504
505 // If set to true, the table's last row will always be visible.
506 trackEnd bool
507
508 // The number of visible rows the last time the table was drawn.
509 visibleRows int
510
511 // The indices of the visible columns as of the last time the table was drawn.
512 visibleColumnIndices []int
513
514 // The net widths of the visible columns as of the last time the table was
515 // drawn.
516 visibleColumnWidths []int
517
518 // The style of the selected rows. If this value is the empty struct,
519 // selected rows are simply inverted.
520 selectedStyle tcell.Style

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected