user443946 user443946 -4 years ago 93
CSS Question

HTML table with row headings

How do you style a table with columns of data instead of rows? (or how do you build a table where the column headings relate to the row headings?)

Answer Source

It's hard to tell from your question, but it sounds like you want to know how to style columns in a table. What you need is the col tag.

Here's an example:

<table>
    <col/>
    <col style="background-color: #ffff00"/>
    <col/>
    <thead>
        <th>One</th>
        <th>Two</th>
        <th>Three</th>
    </thead>
    <tr>
        <td>One</td>
        <td>Two</td>
        <td>Three</td>
    </tr>
</table>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download