我使用最新的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><?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 ")\n";<br/> } else {<br/> echo "\$this is not defined.\n";<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->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->bar();<br/><br/>// Note: the next line will issue a warning if E_STRICT is enabled.<br/>B::bar();<br/>?></pre></td></tr>
</tbody>
</table>
</div>
<div class="col-md-9" style="border: 1px solid black;">test</div>
</div>
</div>
我不知道我能做什么,我曾多次尝试过css。
答案 0 :(得分:5)
尝试使用:
<pre><code> your example code here </code></pre>