A better alternative than   for showing empty HTML table cells?

前端 未结 2 1854
再見小時候
再見小時候 2020-12-09 16:46

It\'s a classic problem - when you have an empty table cell the browser doesn\'t render borders around it. There are also two well-known workarounds. One is to place an

2条回答
  •  [愿得一人]
    2020-12-09 17:20

    You can also put invisible br element:


    It is ridiculous amount of unnecessary code, but it makes the trick - no additional text added yet cell is displayed.

    Note that
    is invalid HTML syntax according to the official specifications http://www.w3.org/TR/html401/struct/text.html#edef-BR. It is valid XHTML syntax however.

提交回复
热议问题