Demi
Demi

Reputation: 447

How do I make the text in the header of my table not bold?

I need to use a rowspan for my table, therefore I (believe) I must use a table header. However, using a table header makes my font bold, which is unwanted. For this HTML, how would I make sure the font in my table header isn't bold? Or, if it's possible, how can I use rowspan without using a table header?

<table border="1">
  <tr>
    <th rowspan="2">Telephone:</th>
<td>555 77 854</td>
  </tr>
  <tr>
    <td>555 77 855</td>
  </tr>
</table>

Upvotes: 22

Views: 79141

Answers (3)

Anson Aştepta
Anson Aştepta

Reputation: 1145

<table border="1">
  <tr>
    <tr rowspan="2"><p style="font-weight:bold">Telephone:</p></tr>
<td>555 77 854</td>
  </tr>
  <tr>
    <td>555 77 855</td>
  </tr>
</table>

I am using internal CSS for you, directly insert the font style inside your table. Copy and pasta this code into your project, it will do the job.

Upvotes: 2

Drown
Drown

Reputation: 5982

Simply overhide the font-weight of the th element in CSS :

th{
    font-weight: normal;
}

JSBin : http://jsbin.com/lizakatuwe/1/

Upvotes: 35

orion
orion

Reputation: 226

You don't need table header at all, you can use rowspan with td too. To make it not bold, override the font-weight in css to normal.

Upvotes: 3

Related Questions