简体   繁体   中英

Why an empty cell doesn't show its border?

谁能根据CSS或HTML规范给我一个解释?

From W3C website, link: http://www.w3.org/TR/REC-html32.html

Tables are commonly rendered in bas-relief, raised up with the outer border as a bevel, and individual cells inset into this raised surface. Borders around individual cells are only drawn if the cell has explicit content. White space doesn't count for this purpose with the exception of   .

Hope that answers your query. In general, do not leave any div, span or td empty, put   and use CSS to set font size and heights to cover up height related issues.

if this is a problem with IE it is impossible to give an explanation based on specification, as IE doesnt follow those

Edit : i am wrong in this case as Kumar's answer prooves :)

just fill em up with a  

take a look at CSS to make an empty cell's border appear?

最简单的解决方案是在单元格(   )中插入一个不间断的空格

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM