Documentation
¶
Overview ¶
Package struct2table: Single struct to HTML table conversion utils Provides convenient functions when converting single struct instances to HTML tables Leverages slice2table package capabilities with single-item slice wrapping Simplifies table generation in single object scenarios
struct2table: 单个结构体到 HTML 表格转换工具 提供将单个结构体实例转换为 HTML 表格的便捷函数 利用 slice2table 包的功能,通过单项切片包装实现 简化单个对象场景的表格生成
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenTable ¶
func GenTable[T any](object *T, options *slice2table.Options) string
GenTable generates HTML table using single struct with custom options Creates single-item slice and applies slice2table generation Enables custom tag configuration when creating single struct tables
GenTable 使用自定义选项将单个结构体生成 HTML 表格 创建单项切片并应用 slice2table 生成 创建单个结构体表格时启用自定义标签配置
func NewTable ¶
NewTable converts single struct instance to HTML table using default options Wraps the struct in a slice and delegates to slice2table processing Returns complete HTML table string representing single object
NewTable 使用默认选项将单个结构体实例转换为 HTML 表格 将结构体包装在切片中并委托给 slice2table 进行处理 返回表示单个对象的完整 HTML 表格字符串
Types ¶
This section is empty.