排位长的降价表 [英] markdown table with long lines

查看:55
本文介绍了排位长的降价表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Markdown 来创建表格.我的描述列包含非常长的文本,因此当我换行时,它在markdown文件上看起来很糟糕:

I am using markdown in order to create a table. My Description column contains very long texts and therefor it looks very bad on the markdown file when I wrap lines:

Argument            | Description |
--------            | ----------- |
appDir              | The top level directory that contains your app. If this
option is used then it assumed your scripts are in |a subdirectory under this path. This option is not required. If it is not specified, then baseUrl below is the anchor point for finding things. If this option is specified, then all the files from the app directory will be copied to the dir: output area, and baseUrl will assume to be a relative path under this directory.  
baseUrl             | By default, all modules are located relative to this path. If baseUrl is not explicitly set, then all modules are loaded relative to the directory that holds the build file. If appDir is set, then baseUrl should be specified as relative to the appDir.
dir                 | The directory path to save the output. If not specified, then the path will default to be a directory called "build" as a sibling to the build file. All relative paths are relative to the build file. 
modules             | List the modules that will be optimized. All their immediate and deep dependencies will be included in the module's file when the build is done. If that module or any of its dependencies includes i18n bundles, only the root bundles will be included unless the locale: section is set above. 

我想换行,因为它对我来说更具可读性.
有没有一种方法可以使表对编辑器更具可读性?

I want to wrap lines since it is more readable for me.
Is there a way to make the table more readable for the editor?

推荐答案

我相信@Naor是正确的:您必须使用HTML来创建换行符,尽管答案中没有显示.并且显示的完整表格代码不是严格必需的:要实现换行,您只需要加倍空格或< br/> 标记.根据Markdown规范:

I believe @Naor is right: You must use HTML to create line breaks, though that is not demonstrated in the answer. And the full table code displayed is not strictly necessary: To achieve a line break you only need double space or <br /> tag. From the Markdown spec:

Markdown支持硬包装"文本段落.这不一样与大多数其他文本到HTML格式器(包括Movable Type的转换换行符"选项)将段落中的换行符插入< br/> 标记.

当您确实想使用Markdown插入< br/> 中断标签时,结束包含两个或多个空格的行,然后键入return.

When you do want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return.

请注意,我必须在文本中添加代码包装器,因为具有SO风味的Markdown要求转义HTML Break标记-因此我们知道< br/> 可行.

Note that I had to add code wrappers to the text because the SO-flavored Markdown requires HTML break tags are escaped - so we know <br /> works.

但是,如果您想做一些更复杂的事情(例如我是*),则可以使用HTML设置各种属性,如下所示:

But, if you want to do something a bit more complex, like I am* you can set various properties with HTML like so:

<table width="300">
  <tr>
    <td> This is some text </td>
    <td> This is some somewhat longer block of text </td>
    <td> This is some very long block of text repeated to make it even longer. This is some very long block of text repeated to make it even longer. This is some very long block of text repeated to make it even longer.  </td>
  </tr>
</table>

我尝试将 style ="width:75%" 添加到< td> s,没有影响.

I tried adding style="width:75%" to the <td>s, to no affect.

*我应该注意到我遇到了这个问题,因为我在使用 GitHub 风格的 Markdown 在表中编写代码时遇到了类似的问题,这非常痛苦.但我要注意这一点,因为它应该使我给出的示例更生动:我说的可行"或无效"的任何内容均来自该环境.

*I should note I came across this because I am having similar problems writing code within tables using GitHub-flavored Markdown, which is very painful. But I'm noting this because it should color the examples I give: Any thing I say 'works' or 'doesn't work' comes from that environment.

如果您的表中有 code 块,那么这可能是不相关的.不过,这与Markdown无关紧要:HTML < code></code> 块会导致表格拉伸.

It might be further worth noting this is irrelevant if you have code blocks within your table. This isn't an issue with Markdown though: HTML <code></code> blocks cause the table to stretch.

这篇关于排位长的降价表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆