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?
Asked
Active
Viewed 241 times
-2
-
If you don't want to use any graphics libraries, [ASCII art](https://en.wikipedia.org/wiki/ASCII_art) is your only hope. – JASLP doesn't support the IES Jul 11 '21 at 14:17
-
There is a character chart in [this answer](https://stackoverflow.com/a/45221670/4142924) which shows border symbols available. You have to select the right code page to get them, because they are non-ASCII characters in the range 128-255. – Weather Vane Jul 11 '21 at 14:20
-
Which OS are you using? – fpiette Jul 11 '21 at 14:42
-
windows 10 operating system – Onkar Chougule Jul 11 '21 at 14:57
1 Answers
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:
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