-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow access to header.content #205
Comments
Hi @PenguRin, how about reuse the table body content somehow? Btw, a sample code would help so much. Thanks. |
Hey @nam-hle, reusing the content is not an option as they have different use cases but the same table layout. All that'd change would literally be the content in like 5 cases.
This is the desired outcome without resolving to @ts-ignore or creating multiple configuration files. Thank you! |
Hey @PenguRin, thanks for clarification. What if we have a function like this: function createTable(title: string, data: string[][]) {
const config: TableUserConfig = {
columnDefault: {
width: 10,
},
header: {
alignment: 'center',
content: title,
},
}
return table(data, config)
} |
Of course that works but as aforementioned, I basically don't see the point of factory functions or any hacky workarounds when we could simply access it, there should be no harm, right? |
Right now it's on readonly mode if you assign the
TableUserConfig
to your config file, however, this prevents reusability if you want to change the content only for another table.Right now I have to either @ts-ignore the config file input if I want to change the content without assigning a type to it or I have to create a completely new config file.
The text was updated successfully, but these errors were encountered: