请教display:table,word-break:break-all,word-wrap:break-word,如下图和代码

##问题如下
我在一个网站上弄了点数据,但是样式显示有点问题,但是对display:table不熟悉,
如下图中红色框的,1/4显示问题
对应链接
http://www.xuekubao.com/tiku/...
clipboard.png

复制过来默认的展示效果

clipboard.png

我是想展示成和图1一样的效果

html

        <span class="MathJye" mathtag="math" style="whiteSpace:nowrap;wordSpacing:normal;wordWrap:normal">
            <table cellpadding="-1" cellspacing="-1" style="margin-right:1px">
                <tr>
                    <td style="border-bottom:1px solid black">5</td>
                </tr>
                <tr>
                    <td>7</td>
                </tr>
            </table>
        </span>吨可以看作1吨的
        <span class="MathJye" mathtag="math" style="whiteSpace:nowrap;wordSpacing:normal;wordWrap:normal">
            <table cellpadding="-1" cellspacing="-1" style="margin-right:1px">
                <tr>
                    <td style="border-bottom:1px solid black">5</td>
                </tr>
                <tr>
                    <td>7</td>
                </tr>
            </table>
        </span>,也可以看作5吨的
        <span class="MathJye" mathtag="math" style="whiteSpace:nowrap;wordSpacing:normal;wordWrap:normal">
            <table cellpadding="-1" cellspacing="-1" style="margin-right:1px">
                <tr>
                    <td style="border-bottom:1px solid black">1</td>
                </tr>
                <tr>
                    <td>7</td>
                </tr>
            </table>
        </span>
阅读 2.5k
1 个回答

在table的样式表中增加

display: inline-block;vertical-align: middle;

就可以了

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题