PAUSE
ENCORE1
BOTCLEAN
ENCORE5
CLEAN
ENCORE
BOX
ILLUSTRATION
TABLE
__________________________________
| PRODUCT DESIGNER PRICE |
|==================================|
| widget Jackson 14.50 |
| mouse trap Gonzales 3.45 |
| thing Lee 103.00 |
|__________________________________|
GO
Let us create an input file using some nroff requests and tbl commands:
First, we want to set the line length to 3 inches.
The nroff request that does this, is:
Answer here:
That is correct!
You've got it on the 2nd try.
Good! Now you understand the concept!
Sorry, the request for setting the line length is .ll
Set the line length request to 3i
Please review Basic nroff Requests.
FORGET2
The correct answer is .ll 3i Observe the result above.
.ll 3i
Next, let's set the page length to 8 lines. See above.
.pl 8
Now we want to format a table like the one above.
First we need to begin the table with the appropriate macro which is:
Answer here:
That is correct!
You've got it on the 2nd try.
Good!, Now you understand the concept!
Sorry, you want the Table Start macro.
The Table Start macro is .TS
The Table Start macro is .TS
FORGET3
The correct answer is .TS Observe the result above.
.TS
Next we want enter the commands to center the table on the page,
set the field separation character to : and to draw a box around
the table. Observe the appropriate commands above.
center tab(:) box;
We must specify how we want each of the three columns formatted.
The tbl command to right justify an entry is r, to left justify an entry
is l, to center an entry is c and to numerically adjust an entry is n.
Observe above the command line to center each of the 3 column headings.
c c c
Now you enter a command line to right justify the product names, left justify
the designer names, and numerically adjust the prices. Since this formatting
will affect all subsequent lines, end the line with a period.
Answer here:
That is correct!
You've got it on the 2nd try.
Good! Now you understand the concept!
Sorry, r is for right adjustment, l is for left, and n for numerical.
Please enter r l n .
FORGET4
The correct answer is r l n . Observe the result above.
r l n .
Next, we enter the first line of the table, the column headings. Each
column should be separated with a colon (:) as we specified.
PRODUCT:DESIGNER:PRICE
We wish to have a double horizontal line after the title. This
is accomplished by placing = in the first column of a line.
=
Finally we write the data entries, and the table end macro.
widget:Jackson:14.50
mouse trap:Gonzales:3.45
thing:Lee:103.00
.TE
Now we're ready to invoke the command to draw the table.
Our input file is called table. Remember that tbl output
is nroff input. Enter the command to preprocess table
and send the output to nroff.
Answer here:
That is correct!
You've got it on the 2nd try.
Good! Now you understand the concept!
Sorry, it should be a combination of tbl and nroff
Sorry, you need to use a PIPE between the two processes.
Please review the Topic 7: Preprocessors
FORGET6
The correct answer is tbl table | nroff
Observe the result.
__________________________________
| PRODUCT DESIGNER PRICE |
|==================================|
| widget Jackson 14.50 |
| mouse trap Gonzales 3.45 |
| thing Lee 103.00 |
|__________________________________|
(Here, the output is passed to the more/pg command so
it doesn't scroll off of the screen.)