0

Hey guys i am trying to create a table like structure in c language using box generating symbol of unicode but right side is not symmetrical like a left one what should i do, is there any trick or function for fix this...

This is the code

#include <stdio.h>

 int main()
{
 int R=89;
 printf("\n┏");
 for(int i=0;i<42;i++)
{
 printf("━");
}
 printf("┓\n");
 printf("┃ SUBJECT   ┃ 
  MAX/MIN  ┃ TERM 1 ┃ TERM 
  2 ┃ TERM 3 ┃");
  printf("\n┃");
  for(int i=0;i<42;i++)
  {
  printf("━");
  }
 printf("┃\n");
 printf("┃ ENGLISH   ┃  
  100/33  ┃  %3d   ┃  %3d   
  ┃  %3d   ┃",R,R,R);
  printf("\n┃");
  for(int i=0;i<42;i++)
 {
  printf("━");
 }
  printf("┃");
 }

This is a output image:

This is a output image

ForceBru
  • 43,482
  • 10
  • 63
  • 98
  • Welcome to Stack Overflow. You should use a fixed width font to display the text. Also, you should remove the `python` tag from the question. – Nicholas Hunter May 30 '21 at 14:53

1 Answers1

0

Your code looks OK.

To track down the actual cause of the misaligned output, make the output of your code simpler and simpler, until the problem disappears. By doing this you will learn where the crucial difference is.

It may be the font, or some spaces, or something else.

Roland Illig
  • 40,703
  • 10
  • 88
  • 121