Make link in table cell fill the entire row height

后端 未结 10 1021
清酒与你
清酒与你 2020-11-27 03:54

I have a table of data and each cell is a link. I want to allow the user to click anywhere in the table cell and have them follow the link. Sometimes the table cells are m

10条回答
  •  独厮守ぢ
    2020-11-27 04:39

    For me the only solution is to replace

    with
    s and style them using display:table and display:table-row accordingly.

    Then you can replace

    with just and style it with display:table-cell.

    Work perfectly even on varying heights of

    contents.

    so original html without anchors:

    content1
    another_line
    content2

    now becomes:

    a:hover
    {
      background-color:#ccc;
    }
        

    提交回复
    热议问题