-2

Without using graphics.h library how to make a table in C program and display our content in that table. It should have table borders around the data and the content should be within it. Is it possible to do that?

halfer
  • 19,824
  • 17
  • 99
  • 186

1 Answers1

0

Here is an example working in Windows console using the default Terminal font. The accented characters are valid ones which are represented by corners, borders and lines.

Output is:

enter image description here

Source code:

#include <stdio.h>

int main()
{
    printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
    printf("º %11s º %11s º\n", "Hello", "World");
    printf("ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍ͹\n");
    printf("º %11s º %11s º\n", "Welcome", "you");
    printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
}

To find the characters, use the character map tool of windows and select terminal font. You can copy/paste characters.

fpiette
  • 11,983
  • 1
  • 24
  • 46