Ravi Maniyar
Ravi Maniyar

Reputation: 667

Add extra td to tr without respective th

I want to add extra td with my delete icon at the end to my tr without its respecting th column.

I want to adjust in such a way that I would not need any jquery and the table tag width is in percentage, so can not add one more th and make it invisible.

Please refer to below html:

<table>
    <tr>
        <th>
            Col1
        </th>
        <th>
            Col 2
        </th>
    </tr>
    <tr>
        <td>
            1
        </td>
        <td>
            2
        </td>
        <td> 
            <!-- this is new column. -->
            Delete Link
        </td>
    </tr>
</table>

p.s. I can not add position absolute css as it would not be possible to include in every screen resolution.

Upvotes: 1

Views: 1885

Answers (2)

Volker E.
Volker E.

Reputation: 6044

Did I understand your problem right? colspan="2" should be helping you.

<table>
<tr>
    <th>
        Col1
    </th>
    <th colspan="2">
        Col 2
    </th>
</tr>
<tr>
    <td>
        1
    </td>
    <td>
        2
    </td>
    <td> 
        <!-- this is new column. -->
        Delete Link
    </td>
</tr>

Upvotes: 1

DevZer0
DevZer0

Reputation: 13535

I believe table needs to have its geometry to be consistent from top to bottom. The best answer i can give you is to hide the top row header column and make the others visible.

Upvotes: 0

Related Questions