52

I want to format an SQL table the right way in a Stack Overflow question.

ID Name
1 Tom

I know the example above is not the right way. I even tried an HTML table approach, but it's still wrong. Please help, because I need to include SQL tables later...

3

1 Answer 1

63

See

Is there a web app to create ASCII art tables?

From our very own Senseful!

I just copied and pasted this from SQL Server Management studio:

-1  Community   210
1   Jeff Atwood 5636
2   Geoff Dalgas    148
3   Jarrod Dixon    101
4   Joel Spolsky    959

Into Senseful's web app and got

╔════╦══════════════╦══════╗
║ -1 ║  Community   ║ 210  ║
╠════╬══════════════╬══════╣
║  1 ║ Jeff Atwood  ║ 5636 ║
║  2 ║ Geoff Dalgas ║  148 ║
║  3 ║ Jarrod Dixon ║  101 ║
║  4 ║ Joel Spolsky ║  959 ║
╚════╩══════════════╩══════╝

(I probably should have ticked the "no header" option...)

13
  • 1
    This is still broken for me in FF5.
    – Jon Seigel
    Commented Jul 5, 2011 at 2:35
  • @jon still can't repro, see screenshot with Firefox 5 about shown at img220.imageshack.us/img220/765/ff5asciitable.png Commented Jul 5, 2011 at 2:46
  • :( chat.meta.stackoverflow.com/files/370/…
    – Jon Seigel
    Commented Jul 5, 2011 at 2:55
  • @jon there's something busted in your OS or config somewhere? What OS? I am using Windows 7. I noticed your windows are not themed as if they are on Windows 7.. Commented Jul 5, 2011 at 7:13
  • Win7 x64. I think I have font smoothing or something turned off -- I will play with my settings later today and let you know.
    – Jon Seigel
    Commented Jul 5, 2011 at 11:44
  • Enabling ClearType fixed the problem. (I'm turning it back off, though.)
    – Jon Seigel
    Commented Jul 5, 2011 at 21:41
  • @JeffAtwood: Glad you found the utility useful! This is exactly the reason I developed it, so thanks for the link!
    – Senseful
    Commented Dec 22, 2011 at 2:06
  • @JonSeigel: does using the "MySQL" instead of "Unicode Art" style still make it appear broken for you?
    – Senseful
    Commented Dec 22, 2011 at 2:09
  • This stopped working, was an excellent tool (July, 2016)
    – TheTechGuy
    Commented Jul 25, 2016 at 14:45
  • 1
    This is working here: senseful.github.io/web-tools/text-table @Dave
    – SqlZim
    Commented Dec 17, 2016 at 14:46
  • If you have a lot of data, you can format it using that app in the link above to create an HTML snippet. Then you can embed it into the stackoverflow post as a code-snippet, and the result is quite gorgeous.
    – devinbost
    Commented May 6, 2017 at 2:32
  • 13 October 2017 new URL: senseful.github.io/text-table Commented Oct 13, 2017 at 21:14
  • This is stale. There is good table support now: meta.stackexchange.com/questions/356997/… Commented Apr 29, 2022 at 16:00

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