5

I'm trying to make table with two identical screenshots, but the right column is wider then left one. Moreover, it depends on text in the row below, but I don't clearly understand, how it depends exactly.

Two simple examples:

![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

The same text length, the same words... What's wrong with hyphens and how can I fix it?

2
  • Was this in a Wiki, or markdown document? Having trouble reproducing this. Commented Aug 5, 2016 at 11:56
  • I think the hyphens make a difference since they make "Drag-and-drop" the widest non-breakable word, thus making the cell's min-content with bigger than if "GNOME" is the widest word. Commented Nov 25, 2022 at 18:57

2 Answers 2

1

If the only difference is truly the hyphen, try a different type of hyphen (e.g. an 'actual' hyphen, instead of the minus sign: http://unicode-table.com/en/2010/).

I should say I cannot reproduce this exactly. The images in my example (left vs. right) are about a pixel or so different, not as much as yours: enter image description here

Sign up to request clarification or add additional context in comments.

Comments

1

I had this same issue and was only able to solve it with html. You can add html code directly into the markdown file:

<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>

1 Comment

This is the simplest solution, and works for GitLab too!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.