html - CSS: container to show PRE tag with scroll bars -
I have some server-side code which can be found in html (): HTML: CSS: (I call it firefight I'm testing in OX) What am I doing wrong? Thanks I will change the following layouts: HTML css for a duplicate (line) table layout, HTML css & lt; Pre & gt; & Lt; / Pre & gt; tag and I would like to put them in a container with scroll bars (in particular, table cells - with equal width). Obviously, I'm going to & lt; Pre & gt; I want to preserve the tag whitelisting format.
& lt; Table & gt; & Lt; TR & gt; & Lt; Th & gt; Colonel 1 & lt; / Th & gt; & Lt; Th & gt; Colonel 2 & lt; / Th & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; Pre & gt; Function This Ietsat (Blaise) test (123456789 test 123456789 test 123456789} & lt; / td> & lt; td & gt; & lt; pre & gt; function this iSatat (blah) (Test 123456789 test 123456789 test 123456789}
table {width: 100%; border: 1px solid red;} TD {width: 50%; overflow: scroll; border: 1px solid blue;} < / pre>
update < p> The easiest way to fix this is:
table-layout: fixed (ironically) table
< The basic answer for CSS for p> is to use the table elements within the pre elements, which is very difficult to calculate relative width Because of issues with which scrolls and actual f Throw the bread out correctly. As such, I'm going to avoid a table based setup, at least not because you are not even displaying tabular data (Aha semantic!).
& lt; Div class = 'container' & gt; & Lt; Div class = 'col' & gt; & Lt; Pre & gt; Function this ietsat {bla} {test 123456789 test 123456789 test 123456789} & lt; / Pre & gt; & Lt; / Div & gt; & Lt; Div class = 'col' & gt; & Lt; Pre & gt; Function this ietsat {bla} {test 123456789 test 123456789 test 123456789} & lt; / Pre & gt; & Lt; / Div & gt; & Lt; / Div & gt;
* {box size: border-box; } Html, body {margin: 0; Padding: 0; }. Container {boundary: 1px solid red; Hidden flurry; } .col {boundary: 1 px solid blue; Swim left; Width: 50%; Overflow: Auto; }
update
div element dislpay Use as appropriate:
& lt; Div class = 'table' & gt; & Lt; Div class = 'row' & gt; & Lt; Div class = 'cell' & gt; & Lt; Pre & gt; Function this ietsat {bla} {test 123456789 test 123456789 test 123456789} & lt; / Pre & gt; & Lt; / Div & gt; & Lt; Div class = 'cell' & gt; & Lt; Pre & gt; Function this ietsat {bla} {test 123456789 test 123456789 test 123456789} & lt; / Pre & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = 'row' & gt; & Lt; Div class = 'cell' & gt; & Lt; Pre & gt; Function this ietsat {bla} {test 123456789 test 123456789 test 123456789} & lt; / Pre & gt; & Lt; / Div & gt; & Lt; Div class = 'cell' & gt; & Lt; Pre & gt; Function this ietsat {bla} {test 123456789 test 123456789 test 123456789} & lt; / Pre & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;
* {box size: border-box; } Html, body {margin: 0; Padding: 0; } .table {border: 1px solid red; Display: Table; Table layout: fixed; Width: 100%; } .cel {border: 1 px solid blue; Overflow: Auto; Performance: table cell; } .row {display: table-row; }
Comments
Post a Comment