css overflow hidden increases height of container

后端 未结 4 886
遥遥无期
遥遥无期 2021-01-31 09:09

Please have a look at this fiddle - http://jsfiddle.net/Z27hC/

var container = document.createElement(\'span\');
container.style.display = \'inline-block\';
cont         


        
4条回答
  •  忘了有多久
    2021-01-31 09:50

    Try setting line-height: 0 for the container and line-height: 20pxfor your cells

    container.style.lineHeight = '0px';
    
    cell.style.lineHeight = '20px';
    

    Fiddle

    Or you can use float: left on your cells

    cell.style.float = 'left';
    

    Fiddle2

提交回复
热议问题