Richard Knop
Richard Knop

Reputation: 83705

Highlight a table column + colspan

jsfiddle link: http://jsfiddle.net/KMzjp/

So I am trying to highlight a table column based on a table header th element (there are three th elements so there should be three columns and the middle one highlighted).

It works without colspans. But when I add colspans to tbody (see the second table), it does not work as expected.

See the jsfiddle link to understand my problem better.

Any ideas how to solve this issue?

Upvotes: 2

Views: 1134

Answers (2)

Dilini Rajapaksha
Dilini Rajapaksha

Reputation: 2718

Changing the <colgroup> to the following (adding span="5") would do.

<colgroup>
    <col class="" span="5"/>
    <col class="highlight" span="5" />
    <col class="" span="5" />
</colgroup>

Upvotes: 1

Richard Knop
Richard Knop

Reputation: 83705

So easy. Good to know col has span attribute:

http://jsfiddle.net/FCTjB/

Upvotes: 1

Related Questions