包裹在表格单元格内部

时间:2014-07-12 20:07:21

标签: css3 twitter-bootstrap twitter-bootstrap-3

我使用最新的twitter bootstrap,我在表格单元格中有预标记有一些麻烦,如果行太长,它应该创建水平滚动但不会发生。

http://jsfiddle.net/52VtD/6958/没有预先

的例子
<div class="row">
    <div class="container">
        <div class="col-md-3" style="border: 1px solid red;">
            this is col-md-3? yes :)
            <table class="table">
                <thead>
                    <tr><th>author</th><th>content</th></tr>
                </thead>
                <tbody>
                    <tr><td>somebody</td><td></td></tr>
                </tbody>
            </table>
        </div>
        <div class="col-md-9" style="border: 1px solid black;">test</div>
    </div>
</div>

http://jsfiddle.net/52VtD/6959/示例预先

<div class="row">
    <div class="container">
        <div class="col-md-3" style="border: 1px solid red;">
            this is col-md-3? no :(
            <table class="table">
                <thead>
                    <tr><th>author</th><th>content</th></tr>
                </thead>
                <tbody>
                    <tr><td>somebody</td><td>why I cannot wrap it?<br/><pre>&lt;?php<br/>class A<br/>{<br/>    function foo()<br/>    {<br/>        if (isset($this)) {<br/>            echo '$this is defined (';<br/>            echo get_class($this);<br/>            echo &quot;)\n&quot;;<br/>        } else {<br/>            echo &quot;\$this is not defined.\n&quot;;<br/>        }<br/>    }<br/>}<br/><br/>class B<br/>{<br/>    function bar()<br/>    {<br/>        // Note: the next line will issue a warning if E_STRICT is enabled.<br/>        A::foo();<br/>    }<br/>}<br/><br/>$a = new A();<br/>$a-&gt;foo();<br/><br/>// Note: the next line will issue a warning if E_STRICT is enabled.<br/>A::foo();<br/>$b = new B();<br/>$b-&gt;bar();<br/><br/>// Note: the next line will issue a warning if E_STRICT is enabled.<br/>B::bar();<br/>?&gt;</pre></td></tr>
                </tbody>
            </table>
        </div>
        <div class="col-md-9" style="border: 1px solid black;">test</div>
    </div>
</div>

我不知道我能做什么,我曾多次尝试过css。

1 个答案:

答案 0 :(得分:5)

尝试使用:

<pre><code> your example code here </code></pre>