Documentation
¶
Overview ¶
Package struct2table: Single struct to HTML table conversion tool Provides convenient functions when converting individual struct instances to HTML tables Leverages slice2table package for core functionality with single-item slice wrapping Simplifies table generation workflow for single object display 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 wrapper 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 for processing Returns complete HTML table string for single object display
NewTable 使用默认选项将单个结构体实例转换为 HTML 表格 将结构体包装在切片中并委托给 slice2table 进行处理 返回用于单个对象显示的完整 HTML 表格字符串
Types ¶
This section is empty.