How to get span to take up the full height of the containing td

后端 未结 1 2137
我寻月下人不归
我寻月下人不归 2021-02-12 16:28

I have a table, and in the left column I want to add an indicator for the row. I\'m using a span to render the indicator, but I can\'t get the span to take up the full height:

相关标签:
1条回答
  • 2021-02-12 16:55

    Should add overflow:auto to the span (and display:block of course)

    <table>
       <tr>
          <td style="padding:0px;"><span style="height:100%; width:5px; background-color:pink;display:block;overflow:auto">&nbsp;</span></td>
          <td>Some content</td>
          <td>Some more content</td>
      </tr>
    </table>
    
    0 讨论(0)
提交回复
热议问题