如何在GitHub markdown中使表格列宽相同?

4
我正在尝试制作一张包含两个相同截图的表格,但右列比左列宽。此外,它还取决于下面行的文本,但我不清楚它确切地依赖于什么。
以下是两个简单的示例:
![img](https://raw.githubusercontent.com/hant0508/tmp/master/1.png) | ![img](https://raw.githubusercontent.com/hant0508/tmp/master/1.png)
:---:|:---:
Usage on GNOME 3 | Drag-and-drop on GNOME 3

enter image description here

![img](https://raw.githubusercontent.com/hant0508/tmp/master/1.png) | ![img](https://raw.githubusercontent.com/hant0508/tmp/master/1.png)
:---:|:---:
Usage on GNOME 3 | Drag and drop on GNOME 3

enter image description here

同样的文本长度,同样的单词……连字符有什么问题,如何解决?


这是在维基百科还是Markdown文档中?我在复现时遇到了一些问题。 - BrechtDeMan
我认为连字符很重要,因为它们使“拖放”成为最宽的不可分割单词,从而使单元格的最小内容比“GNOME”是最宽的单词时更大。 - Joseph Marinier
2个回答

1
如果唯一的区别确实是连字符,请尝试使用不同类型的连字符(例如“实际”连字符,而不是减号:http://unicode-table.com/en/2010/)。
我应该说我无法完全复制这个问题。我的示例中的图像(左侧与右侧)相差约一个像素,没有您的那么多: enter image description here

0
我遇到了同样的问题,只能通过使用HTML来解决。你可以直接在Markdown文件中添加HTML代码:
<table width="100%">
  <thead>
    <tr>
      <th width="50%">First header</th>
      <th width="50%">Second header long</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td width="50%"><img src="https://docs.github.com/assets/cb-194149/images/help/images/view.png"/></td>
      <td width="50%"><img src="https://docs.github.com/assets/cb-194149/images/help/images/view.png"/></td>
    </tr>
  </tbody>
</table>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接