Reputation: 3050
I'm creating a PDF document and inside of it i'm creating a table.
I want some cells to have bold text style.
How can this be done?
Upvotes: 0
Views: 2420
Reputation: 9905
Before adding text to the cell, Create a new paragraph with the text you want to add.
Paragraph paragraph=new Paragraph("Test in the Cell");
paragraph.getFont().setStyle(Font.BOLD);
Cell c=new Cell(paragraph);
table.addCell(c);
For those Cells in which you need not want the bold just simply remove the line
paragraph.getFont().setStyle(Font.BOLD);
Upvotes: 3