Skip to content

Add styling hooks, or at least table ID for CSS targeting #9

@ysageev

Description

@ysageev

Love this package. I have a lot of tables that I need to display on the fly and would like this tool built out some more. In particular, styling. I'm thinking tableify() could take a styleOptions object that looks something like this:

const styleOptions = {
   tableStyle: "font-family: Helvetica, Arial, sans-serif; font-size: 11px; line-height: 20px;",
   trStyle: null,
   tdStyle: "padding: 4px 2px; text-align: left; vertical-align: top; background-color: #eaeaea;"
 }

These then get inserted into the tag with e.g. style="'" + styleOptions.tableStyle + "'"
Alternatively, one could specify the table ID to target it with CSS by passing the id to tableify(). So you could write tableify("myTableID")

...and then you could have CSS that targets, like

#myTableId table {
   font-weight: bold;
   font-size: 10px;
   font-weight: bold;
}

#myTableId td {
   vertical-align: top;
   text-align: left;
   float: left;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions