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.

Needs option for max table width

See original GitHub issue

What is the problem?

Not possible to set max width on table format.

Example, when formatting a table like this:

| H1                | H2                                  | H3  |
| :------------- | :------------------------- | :---- |
| Bar                | Some very<br>long line of<br>text Some very<br>long line of<br>textSome very<br>long line of<br>text Some very<br>long line of<br>text | Foo |

it will format it into something like this:

| H1                 | H2                                                                                                                                     | H3  |
| :----------------- | :------------------------------------------------------------------------------------------------------------------------------------- | :-- |
| Bar                | Some very<br>long line of<br>text Some very<br>long line of<br>textSome very<br>long line of<br>text Some very<br>long line of<br>text | Foo |

I would like a setting to set the max amount of dashes (“-” in “| :— |”) since Pandoc will use number of dashes to set the rendered table width in html.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
yzhang-ghcommented, May 23, 2019

Thanks for the information.

I will leave this (option for max cell width) as a feature request. Let’s see whether there are other people having the same issue.

an option to only format the table the cursor is at

I will add the support for DocumentRangeFormatting later. (Probably next weekend as I am away this week)

0reactions
ownbeecommented, May 23, 2019

I’ve tried it out and spaces is not taken into account by Pandoc. However, I would prefer not to pad with spaces since the whole idea is to have a small/neat table in the markdown file and just a few rows that stand out from the rest of the table.

No, its not meaningless, I usually have a few tables that have one or two rows that are long and but I still want to format the rest of the tables.

Like this:

| H1   | H2     | H3   |
| :---- | :----- | :--- |
| Bar1  | Normal | Foo  |
| Bar2  | Very long long long text | Foo  |
| Bar3  | Normal | Foo  |
| Bar4  | Normal | Foo  |

If you don’t think this is a good idea, can you at least consider an option to only format the table the cursor is at? Because now, all tables in the whole file are formatted when Alt-Shift-F. Then I could format the tables with long rows myself.

I don’t think it’s possible to set the width of tables in Pandoc in an easy way. Maybe with html tags and css inside the markdown but that is too much effort.

PS: Seems like I accidentally closed the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting the maximum width of a table - html - Stack Overflow
If you want to make your max-width to work, you need to set the CSS property table-layout: fixed; on the table and use...
Read more >
max-width - CSS: Cascading Style Sheets - MDN Web Docs
The max-width CSS property sets the maximum width of an element. It prevents the used value of the width property from becoming larger...
Read more >
Should I set maximum table width? - UX Stack Exchange
One important consideration is which unit to use for the maximum width. rem or em might be the best choice. – CodesInChaos. Jan...
Read more >
DataTable Width & Column Width - Dash Plotly
It is not possible to set a max-height. All of the cells need to be the same height. Subscribe to plotly/dash-table#737 for updates...
Read more >
Resize a table, column, or row - Microsoft Support
On the Layout tab, in the Cell Size group, click AutoFit. Shows the options in the Cell Size group. Do one of the...
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