package core:text/table

⌘K
Ctrl+K
or
/

    Types

    Cell ¶

    Cell :: struct {
    	text:      string,
    	alignment: Cell_Alignment,
    }
    Related Procedures With Returns

    Cell_Alignment ¶

    Cell_Alignment :: enum int {
    	Left, 
    	Center, 
    	Right, 
    }
    Related Procedures With Parameters

    Table ¶

    Table :: struct {
    	lpad:             int,
    	rpad:             int,
    	// Cell padding (left/right)
    	cells:            [dynamic]Cell,
    	caption:          string,
    	nr_rows:          int,
    	nr_cols:          int,
    	has_header_row:   bool,
    	table_allocator:  runtime.Allocator,
    	// Used for allocating cells/colw
    	format_allocator: runtime.Allocator,
    	// Used for allocating Cell.text when applicable
    	dirty:            bool,
    	// The following are computed on build()
    	colw:             [dynamic]int,
    	// Width of each column (including padding, excluding borders)
    	tblw:             int,
    }
    Related Procedures With Parameters

    Constants

    This section is empty.

    Variables

    This section is empty.

    Procedures

    build ¶

    build :: proc(tbl: ^Table) {…}

    caption ¶

    caption :: proc(tbl: ^Table, value: string) {…}

    destroy ¶

    destroy :: proc(tbl: ^Table) {…}

    first_row ¶

    first_row :: proc(tbl: ^Table) -> int {…}

    format ¶

    format :: proc(tbl: ^Table, _fmt: string, args: ..any, loc := #caller_location) -> string {…}

    get_cell ¶

    get_cell :: proc(tbl: ^Table, row, col: int, loc := #caller_location) -> ^Cell {…}
    header :: proc(tbl: ^Table, values: ..any, loc := #caller_location) {…}

    header_row ¶

    header_row :: proc(tbl: ^Table) -> int {…}

    init_with_allocator ¶

    init_with_allocator :: proc(tbl: ^Table, format_allocator := context.temp_allocator, table_allocator := context.allocator) -> ^Table {…}

    init_with_mem_arena ¶

    init_with_mem_arena :: proc(tbl: ^Table, format_arena: ^mem.Arena, table_allocator := context.allocator) -> ^Table {…}

    init_with_virtual_arena ¶

    init_with_virtual_arena :: proc(tbl: ^Table, format_arena: ^mem_virtual.Arena, table_allocator := context.allocator) -> ^Table {…}

    last_row ¶

    last_row :: proc(tbl: ^Table) -> int {…}

    padding ¶

    padding :: proc(tbl: ^Table, lpad, rpad: int) {…}

    row ¶

    row :: proc(tbl: ^Table, values: ..any, loc := #caller_location) {…}

    set_cell_alignment ¶

    set_cell_alignment :: proc(tbl: ^Table, row, col: int, alignment: Cell_Alignment, loc := #caller_location) {…}

    set_cell_value ¶

    set_cell_value :: proc(tbl: ^Table, row, col: int, value: any, loc := #caller_location) {…}

    set_cell_value_and_alignment ¶

    set_cell_value_and_alignment :: proc(tbl: ^Table, row, col: int, value: string, alignment: Cell_Alignment) {…}

    stdio_writer ¶

    stdio_writer :: proc() -> io.Stream {…}

    strings_builder_writer ¶

    strings_builder_writer :: proc(b: ^strings.Builder) -> io.Stream {…}

    write_ascii_table ¶

    write_ascii_table :: proc(w: io.Stream, tbl: ^Table) {…}

    write_byte_repeat ¶

    write_byte_repeat :: proc(w: io.Stream, n: int, b: u8) {…}

    write_html_table ¶

    write_html_table :: proc(w: io.Stream, tbl: ^Table) {…}

    write_markdown_table ¶

    write_markdown_table :: proc(w: io.Stream, tbl: ^Table) {…}
     

    Renders table according to GitHub Flavored Markdown (GFM) specification

    write_table_cell ¶

    write_table_cell :: proc(w: io.Stream, tbl: ^Table, row, col: int) {…}

    write_text_align ¶

    write_text_align :: proc(
    	w:                io.Stream, 
    	colw, lpad, rpad: int, 
    	text:             string, 
    	alignment:        Cell_Alignment, 
    ) {…}

    Procedure Groups

    Source Files

    Generation Information

    Generated with odin version dev-2024-03 (vendor "odin") Windows_amd64 @ 2024-03-01 21:10:24.324289500 +0000 UTC