diff --git a/src/widgets/Table.zig b/src/widgets/Table.zig index 04b7de9..05f4fce 100644 --- a/src/widgets/Table.zig +++ b/src/widgets/Table.zig @@ -48,6 +48,8 @@ pub const TableContext = struct { /// Y Offset for drawing to the parent Window. y_off: usize = 0, + /// X Offset for printing each Cell/Item. + cell_x_off: usize = 1, /// Column Width /// Note, if this is left `null` the Column Width will be dynamically calculated during `drawTable()`. @@ -327,7 +329,7 @@ pub fn drawTable( .text = if (item_txt.len > col_width and alloc != null) try fmt.allocPrint(alloc.?, "{s}...", .{item_txt[0..(col_width -| 4)]}) else item_txt, .style = .{ .fg = row_fg, .bg = row_bg }, }}; - _ = try item_win.print(seg[0..], .{ .wrap = .word }); + _ = try item_win.print(seg[0..], .{ .wrap = .word, .col_offset = table_ctx.cell_x_off }); } } }