How to make the tags on the first column highlighted and stand out

      <tr>
       <td>><span class="table"><table></span></td>
       <td>Table</td>
       <td>The wrapper element for all HTML tables</td>
      </tr>
      <tr>
        <td><span class="head"><thead></span></td>
       <td>Table Head</td>
       <td>The set of rows defining the column headers in the table</td>
      </tr>
      <tr>
        <td><span class="body"><tbody></span></td>
       <td>Table Body</td>
       <td>The set of rows containing actual table data</td>
      </tr>
      <tr>
        <td><span class="row"><trow></span></td>
       <td>Table Row</td>
       <td>The table row container</td>
      </tr>
      <tr>
        <td><span class="data"><td></span></td>
       <td>Table Data</td>
       <td>The table row container</td>
      </tr>
      <tr>
       <td><span class="foot"><tfoot></span></td>
       <td>Table Foot</td>
       <td>The set of rows defining the footer in a table</td>
      </tr>
    </tbody>

Table Attributes

I could only show part of the code so you could see what I mean. Any tips or suggestions is greatly appreciated. Thank you.

You could put a colgroup element with some col elements in it at the beginning of the table.
Here’s an example of doing that and using inline styling to give the first column a yellow background color.

      <colgroup>
        <col style="background-color: yellow" />
        <col />
        <col />
      </colgroup>

I used 3 col elements because there are 3 td elements in each row, and I didn’t use the span attribute.

example code
        <table>
          <colgroup>
            <col style="background-color: black; color: white" />
            <col />
            <col />
          </colgroup>
          <tbody><!-- each row has 3 td elements -->
            <tr><td>a</td><td>b</td><td>c</td></tr>
            <tr><td>d</td><td>e</td><td>f</td></tr>
          </tbody>
        </table>

Thanks for the reply. I have the html file all figured out now. Now im trying to link the css styling part of it.

You could use CSS to accomplish something similar in another way.

tr > td:first-child {
  background-color: yellow;
}

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.