22

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>
Demi
  • 427
  • 1
  • 5
  • 7

3 Answers3

33

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

th{
    font-weight: normal;
}

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

Resigned June 2023
  • 4,638
  • 3
  • 38
  • 49
Drown
  • 5,852
  • 1
  • 30
  • 49
3

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.

orion
  • 226
  • 2
  • 9
2
<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.

Ethan Furman
  • 63,992
  • 20
  • 159
  • 237
Anson Aştepta
  • 1,125
  • 2
  • 14
  • 38