Changing the Font in a Single Table Cell
To change the font in a single table cell, set the Font property for the cell. Add the following code to the Form_Load event before the Add and Generate methods:
table.Cells(1, 1).Style.Font = New Font("Tahoma", 12, FontStyle.Bold)
table.Cells(1, 1).Style.TextColor = Color.DarkGreen
• C#
table.Cells[1, 1].Style.Font = new Font("Tahoma", 12, FontStyle.Bold);
table.Cells[1, 1].Style.TextColor = Color.DarkGreen;
What You've Accomplished
The text in cell (1,1) appears in 12 point, Dark Green, Bold Tahoma font:
|