15

I often use tables to improve posts with many and/or large images: it makes it easier for the reader to get an overview of a given situation, it effortlessly turns the images into links so their original sizes can be seen if the reader wishes so, and it just makes it more pleasing to look at.

When there is an uneven amount of images, or another reason to maintain a certain width or height or ratio, I often resort to use the HTML non-breaking space character   to even out adjacent cells.
E.g., assuming image 1 is taller than image 2, and I want to level their heights, I could do this:

|--------------|--------------------------------------------------------------------|
|[![img][1]][1]|[![img][2]][2]         |

Would it be possible to control the relative width of the individual cells using those dashes?

This, for example:

|10 dashes |20 dashes           |
|----------|--------------------|

would return this:

one length two lengths                     

And if not this, could something similarly user-friendly be implemented to easily control the width of a table cell?

8
  • 2
    I'm not sure if it would be better to post this as an answer on the table support thread.
    – Joachim
    Commented Sep 16, 2021 at 19:36
  • 2
    This would probably make a lot of older tables look weird since the dashes wouldn't have been carefully measured out.
    – bobble
    Commented Sep 16, 2021 at 19:49
  • @bobble That's a very good point. Maybe an additional row with different specific characters to control the width?
    – Joachim
    Commented Sep 16, 2021 at 19:51
  • 1
    Given that you can directly control the displayed width and height of an image, which will directly determine the size of the table's rows and columns, the capability for largely what you desire is already available, at least for your use case with images. However, doing it that was does assume a specific width for the viewport, which will have issues being responsive. If you really want this, then you could always use a snippet in which you have direct control of the HTML and CSS.
    – Makyen
    Commented Sep 16, 2021 at 21:16
  • @Makyen Stack Snippets are only available on the coding-related sites. meta.stackexchange.com/a/239508/334566
    – PM 2Ring
    Commented Sep 16, 2021 at 22:07
  • @PM2Ring I'm aware of that. The OP didn't specify a specific site, and at least some sites do support that option.
    – Makyen
    Commented Sep 16, 2021 at 22:13
  • @Makyen True, but this would be just as convenient for text. And, no, I didn't specify specific pages, because I assumed the markdown table would behave the same way on all websites - I wasn't aware of Stack Snippets, TBH.
    – Joachim
    Commented Sep 17, 2021 at 1:12
  • 9
    I expect it's unlikely SE will implement this, as it's part of neither CommonMark nor GitHub Flavored Markdown (which has the tables extension). You might find it more effective to submit a feature request for SE to support HTML <table>, <thead>, <tbody>, <tr>, <th>, and <td> (and, perhaps, <tfoot>, <caption>, <colgroup>, and <col>) along with the style HTML attribute when containing a width that's specified in percentage (and px), and maybe a height (all of which are supported in CommonMark).
    – Makyen
    Commented Sep 17, 2021 at 2:02

0

You must log in to answer this question.

Browse other questions tagged .