I\'m creating an output in Java using printf() to create table headers. One of the columns needs variable width.
Basically it should look like this:
Java does not support the "*" format specifier. Instead, insert the width directly into the format string:
int spacing = numCoords * 7; //size of column System.out.printf("Trial %" + spacing + "s", "Column Heading");