TD style font-weight not applying bold formatting

Issue

Am I being really really silly here?

I’ve tested this line completely on it’s own and the text is NOT bold?

<td style="font-weight:bold">example</td>

Surely this should work? I’ve tested this on my server and on two HTML emulators. Am I missing something obvious?

Solution

<td> tag can be used only inside <table> and strictly wrapped with <tr> tag as:

<table>
  <tbody>
    <tr>
      <td style="font-weight: bold">text here</td>
    </tr>
  </tbody>
</table>

https://www.w3.org/TR/html4/struct/tables.html#edef-TD

Answered By – Sergey Sklyar

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published