question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

markdown : compact formatted table

See original GitHub issue

Prettier 1.15.3 Input:

| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| addon | called from timepicker panel to render some addon to its bottom | function | - |
| allowEmpty | allow clearing text | boolean | true |
| autoFocus | get focus when component mounted | boolean | false |
| className | className of picker | string | '' |
| clearText | clear tooltip of icon | string | clear |
| defaultOpenValue | default open panel value, used to set utcOffset,locale if value/defaultValue absent | [moment](http://momentjs.com/) | moment() |
| defaultValue | to set default time | [moment](http://momentjs.com/) | - |
| disabled | determine whether the TimePicker is disabled | boolean | false |
| disabledHours | to specify the hours that cannot be selected | function() | - |
| disabledMinutes | to specify the minutes that cannot be selected | function(selectedHour) | - |
| disabledSeconds | to specify the seconds that cannot be selected | function(selectedHour, selectedMinute) | - |
| format | to set the time format | string | "HH:mm:ss" |
| getPopupContainer | to set the container of the floating layer, while the default is to create a div element in body | function(trigger) | - |
| hideDisabledOptions | hide the options that can not be selected | boolean | false |
| hourStep | interval between hours in picker | number | 1 |
| inputReadOnly | Set the `readonly` attribute of the input tag (avoids virtual keyboard on touch devices) | boolean | false |

Output:

| Property            | Description                                                                                      | Type                                   | Default    |
| ------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------- | ---------- |
| addon               | called from timepicker panel to render some addon to its bottom                                  | function                               | -          |
| allowEmpty          | allow clearing text                                                                              | boolean                                | true       |
| autoFocus           | get focus when component mounted                                                                 | boolean                                | false      |
| className           | className of picker                                                                              | string                                 | ''         |
| clearText           | clear tooltip of icon                                                                            | string                                 | clear      |
| defaultOpenValue    | default open panel value, used to set utcOffset,locale if value/defaultValue absent              | [moment](http://momentjs.com/)         | moment()   |
| defaultValue        | to set default time                                                                              | [moment](http://momentjs.com/)         | -          |
| disabled            | determine whether the TimePicker is disabled                                                     | boolean                                | false      |
| disabledHours       | to specify the hours that cannot be selected                                                     | function()                             | -          |
| disabledMinutes     | to specify the minutes that cannot be selected                                                   | function(selectedHour)                 | -          |
| disabledSeconds     | to specify the seconds that cannot be selected                                                   | function(selectedHour, selectedMinute) | -          |
| format              | to set the time format                                                                           | string                                 | "HH:mm:ss" |
| getPopupContainer   | to set the container of the floating layer, while the default is to create a div element in body | function(trigger)                      | -          |
| hideDisabledOptions | hide the options that can not be selected                                                        | boolean                                | false      |
| hourStep            | interval between hours in picker                                                                 | number                                 | 1          |
| inputReadOnly       | Set the `readonly` attribute of the input tag (avoids virtual keyboard on touch devices)         | boolean                                | false      |

Expected behavior:

I need a compact formatted table. It made me unable to format all the code.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:16
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
ikatyangcommented, Jan 2, 2019

This looks like an issue related to editor word wrapping. The current output with word wrapping disabled (just like the rendered codeblock in the OP) looks more readable to me, while the proposed output (https://github.com/prettier/prettier/issues/5651#issuecomment-447822208) is more readable only if the word wrapping is enabled, which I think it’s usually the case for --prose-wrap never. So I think it should be better to apply this formatting only if it exceeds print width and --prose-wrap never is used, what do you think?

2reactions
j-f1commented, Dec 17, 2018

Feel free to use <!-- prettier-ignore --> to stop Prettier from formatting this table. Personally, an aligned table is easier for me to read, although we could compress tables wider than the printWidth.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tables · Styleguide Markdown
Prefer lists and only use tables for small, non-complex and single line content. ... less compact, though much more edit-friendly and more elegant...
Read more >
Extended Syntax - Markdown Guide
You can format the text within tables. For example, you can add links, code (words or phrases in backticks ( ` ) only,...
Read more >
How to Create a Markdown Table - MakeUseOf
Markdown makes it simple to format text online, such as bold text ... Step 4: Check the Compact mode to condense the table...
Read more >
Markdown Compact Table Formatter - Visual Studio Marketplace
Extension for Visual Studio Code - Format Markdown tables in a compact way / 以紧凑的方式格式化 Markdown 表格.
Read more >
R markdown tables rendered in compact format - Stack Overflow
R markdown tables rendered to Word documents are in a compact format, which creates problems as they are not bounded by the text...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found