Answer the question
In order to leave comments, you need to log in
How to format a table?
Hello. Please tell me how to align the table.
String.format("%-20s %-20s %-20s", userDTO.getUserId(), userDTO.getName(), userDTO.getEmail())
document.add(new Paragraph(String.format("|%-20s| %-20s| %-20s| %-30s| %-20s|\n\n",
userDTO.getUserId(),
userDTO.getName(), userDTO.getSecondName(),
userDTO.getEmail().trim(), userDTO.getContracts())));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question