51

I would like to use tables in answers and questions. Without such support, I find myself using ASCII art tables with the code-text tool, but that takes too long, and isn't really maintainable.

This could be used to illustrate memory cells, and of course to create "real tables" with information contained.


It looks like HTML tables using <table> are not going to be supported. I would like to ask for a feature in the editor that allows and supports creating tables using ASCII art (so the nasty manual managing with spaces will go away), at the very least (no CSS guy - but could imagine there are other styling techniques too).


As a workaround, google chart supports the creation of graphviz diagrams, which is also able to render some limited HTML for creating tables. So the following URL:

chart.apis.google.com/chart?cht=gv&chl=digraph html{abc [shape=none,margin=0,label=<<table border="1" cellspacing="2"><tr><td bgcolor="red"><font color="white">Algorithm</font></td><td bgcolor="darkgreen"><font color="white">Example</font></td></tr><tr><td>First Row 1</td><td PORT="tryp">Second Row 2</td></tr><tr><td>Last Row 1</td><td>Last Row 2</td></tr></table>>]; Funny -> abc:tryp:ne;}

Gives when properly encoded this picture

alt text

3
  • I would love basic <table> tags! It is something that is available in most places, and to just exclude it without reason does not make sense. Rather discuss within the community and see how we can come up with workable solution.
    – AquaAlex
    Jul 22 '14 at 12:37
  • A workaround is to use ASCII art, like so. Sep 24 '18 at 11:14
  • 1
    Relevant update: Stack Exchange is rolling out native table support. It goes into testing today on MSE and on the DBA Meta, then rolls out to DBA.SE itself a week later, and will be available network-wide a week after that. It uses "GitHub-flavored Markdown" table syntax (since CommonMark doesn't include a specification for tables at the moment).
    – V2Blast StaffMod
    Nov 24 '20 at 1:06
14

Some versions of Markdown come with support for tables natively too.

Using Markdown as a proxy for table-markup eliminates the worries that somebody may forget to close a TD. The markdown simply won't translate into HTML if it's not 100% correct. As an example, ** won't cause all of the text on the page from here on to be bold.

8
  • If I had to guess, I'd say a reason they don't want to allow tables is that they're very easy to mess up, which results in Very Bad Things, especially since the site layout is in tables. That's just a guess, though. Jul 14 '09 at 16:04
  • 7
    Using markdown as a proxy for tables eliminates that problem. You can't not-complete a TD with Markdown.
    – Sampson
    Jul 14 '09 at 16:07
  • 4
    Table based layout!? BLASPHEMY
    – TheTXI
    Jul 14 '09 at 16:07
  • 2
    @thetxi, I'm advocating using it for tabular data only.
    – Sampson
    Jul 29 '09 at 13:10
  • en.wikipedia.org/wiki/Markdown_Extra
    – dbr
    Jul 31 '09 at 4:30
  • Jonathan, can you link to some of the version you mentioned in your answer? Thanks!
    – trusktr
    Oct 12 '13 at 22:45
  • @trusktr It's the same version dbr referenced in the comment above.
    – Sampson
    Oct 13 '13 at 15:15
6

The < pre > tag or taking a screen shot works OK so far, but I agree that some better support would be nice.

6

Jeff has specifically said that tables WILL NOT be allowed in questions and answers.

Thanks to Pesto for drudging up the post: Atwood Laying Down The Law

6
  • 3
    Because it would mess up the beautiful SO markup, right? Jul 14 '09 at 15:54
  • 1
    Hell if I know. Tables would rock, but I doubt it will be enabled any time soon.
    – TheTXI
    Jul 14 '09 at 15:55
  • 3
    "We do not and will not allow table tags -- sorry. This is intentional and by design. If you need a quick and dirty "table", use <pre> and ASCII layout." From stackoverflow.com/questions/31657/… Jul 14 '09 at 15:57
  • 9
    I think he was specifically referring to table markup in HTML. At least I hope so because the only other way to interpret that is "You don't get nice tabular formatting, because F you."
    – JohnFx
    Sep 29 '11 at 20:11
  • @HilariousComedyPesto That link is dead
    – SQL Police
    Mar 12 '16 at 13:04
  • Booooooooooooo!
    – NetMage
    Nov 14 '19 at 1:26

Not the answer you're looking for? Browse other questions tagged .