I have a project using Slate, which allows using table markup in the following format.
Name | Value -------|------------------- `Value-One` | Long explanation `Value-Two` | Long explanation `etc` | Long explanation
My problem is that the first column is rendered too narrow, and is wrapping the content (i.e. breaking the code values onto two lines) rather than displaying it on a single line. My preference is that the first column be wide enough to display the name/key fully, and then the second column can take up the rest of the available space.
My question is if it is possible (and therefore, how) to set the column width via markup, or at least add a class to the table via markup (so that I can style a particular table via CSS). Or is there a better approach to this? I'd prefer not to have to write out the table in full HTML (which would be a last resort option).
Markdown makes it simple to format text online, such as bold text, and links. You can even make tables with Markdown.
To set the table width in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <table> tag, with the CSS property width.
I was looking the answer for a long time and finally figured out this solution. markdown columns width is determined by the longest cell in the column, so use html space entity
as many times as needed to widen the column. it looks ugly in edit mode but finally do the trick:
Name | Value -------|------------------- `Value-One` | Long explanation `Value-Two` | Long explanation `etc` | Long explanation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With