开发者

How to create a table within a legend with overflow-x

开发者 https://www.devze.com 2023-02-09 02:33 出处:网络
can someone tell me how i can create a table within a legend which creates a scrollbar if th its bigger than the div in which is it.

can someone tell me how i can create a table within a legend which creates a scrollbar if th its bigger than the div in which is it.

<div style="width:700px;">
<h1>wefwfwfwef</h1>
<fieldset>
    <div style="width:700px;">
    <label>sdfsdfsdj dfsdfsdfsdj sdfsdfsdfsdfsdj sdfsdfsdfsdfsdj sdfsdf</label>
    <table style="background-color:white;color:black;"> <!-- This table should only be 700 px width... without width definition (because its display:block)-->
        <tr>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
        </tr>
    </table>
    </div>
</fieldset>
<div style="width: 100%;background-color:black;overflow-x:auto;">
    <table style="background-color:white;color:black;display:block"> 
        <tr>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
          开发者_如何转开发  <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
            <td>ehehef<td>
        </tr>
    </table>
<div>
</div>


Something like this? http://jsbin.com/ubomo4

If yes just add overflow-x:scroll; in the css properties of the div under the fieldset.

0

精彩评论

暂无评论...
验证码 换一张
取 消