How do I change the font color in an html table?

167,959

Solution 1

<table>
<tbody>
<tr>
<td>
<select name="test" style="color: red;">
<option value="Basic">Basic : $30.00 USD - yearly</option>
<option value="Sustaining">Sustaining : $60.00 USD - yearly</option>
<option value="Supporting">Supporting : $120.00 USD - yearly</option>
</select>
</td>
</tr>
</tbody>
</table>

Solution 2

Something like this, if want to go old-school.

<font color="blue">Sustaining : $60.00 USD - yearly</font>

Though a more modern approach would be to use a css style:

<td style="color:#0000ff">Sustaining : $60.00 USD - yearly</td>

There are of course even more general ways to do it.

Solution 3

if you need to change specific option from the select menu you can do it like this

option[value="Basic"] {
  color:red;
 }

or you can change them all

select {
  color:red;
}

Solution 4

table td{
  color:#0000ff;
}

<table>
  <tbody>
    <tr>
    <td>
      <select name="test">
        <option value="Basic">Basic : $30.00 USD - yearly</option>
        <option value="Sustaining">Sustaining : $60.00 USD - yearly</option>
        <option value="Supporting">Supporting : $120.00 USD - yearly</option>
      </select>
    </td>
    </tr>
  </tbody>
</table>
Share:
167,959
ttom
Author by

ttom

Updated on May 02, 2020

Comments

  • ttom
    ttom about 4 years

    How do I change the font color in an html table?

    <table>
    <tbody>
    <tr>
    <td>
    <select name="test">
    <option value="Basic">Basic : $30.00 USD - yearly</option>
    <option value="Sustaining">Sustaining : $60.00 USD - yearly</option>
    <option value="Supporting">Supporting : $120.00 USD - yearly</option>
    </select>
    </td>
    </tr>
    </tbody>
    </table>
    

    I have tried

    <span style="color: #0000ff;"> 
    </span> 
    

    in multiple locations ... which doesn't work.