0

I have to create a table and I tried doing this using tbl

This is how the table should look:

enter image description here

But I can't find a way how to use the tbl command to create this table in a file called authors.

1
  • 4
    Please edit your question and show what you tried and what result you got. Then we can help you to fix your code. Hint: The document Lesk, M.E.: "TBL -- A Program to Format Tables" contains several examples. You will probably find PDF versions if you search for the title. Commented Jan 19, 2022 at 17:32

1 Answer 1

1

Using nroff:

nroff -t -Tascii

OR groff:

groff -t -Tascii

[ If you run into issues with utf8 characters, try (for example) groff -t -Tutf8 ].

Sample input from Delete columns that contains only numbers , changing third line to L L L L L L . to Left-align column headers are instead of having them center-aligned (as noted by @they in the comments):

.TS
tab(@);
L L L L L L .
Nr.@Autor@Titlu@Cod@Tiraj@Tara
1@Gauss Carl@Aritmetica 1@297485@11454@Germania
2@Gauss Carl@Aritmatica 2@297484@10254@Germania
3@Gauss Carl@Aritmetica 3@297455@45872@Germania
.TE

Note, it's common to have a two-line column formatting string, one for the column header alignment, the second for the data format/alignment. Below designating N numeric vs A alphabetic column-alignment:

.TS
tab(@);
L L L L L L 
N A A N N A .
Nr.@Autor@Titlu@Cod@Tiraj@Tara
1@Gauss Carl@Aritmetica 1@297485@11454@Germania
2@Gauss Carl@Aritmatica 2@297484@10254@Germania
3@Gauss Carl@Aritmetica 3@297455@45872@Germania
.TE

See section 2.2. Format of "Tbl — A Program to Format Tables" by L. L. Cherry and M. E. Lesk for examples. Also, section 2.6 Invocation Examples of groff--The GNU implementation of troff by Trent A. Fisher and Werner Lemberg.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.