Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 我如何定位桌子?_Html_Css_Position_Css Position - Fatal编程技术网

Html 我如何定位桌子?

Html 我如何定位桌子?,html,css,position,css-position,Html,Css,Position,Css Position,如何防止表格单元格重叠?我需要将表数据中左侧的表保持在固定位置,以便右侧的数据需要滚动,左侧的td单元将保留在那里 我这里有一个html的例子- 和代码- <table ID="Table1" Width="100%"> <tr> <td align="center" class="style2"> <table border="" style="width:20%;position:fixed;lef

如何防止表格单元格重叠?我需要将表数据中左侧的表保持在固定位置,以便右侧的数据需要滚动,左侧的td单元将保留在那里

我这里有一个html的例子-

和代码-

<table ID="Table1" Width="100%">
    <tr>
        <td align="center" class="style2"> 
            <table border="" style="width:20%;position:fixed;left:54px; top: 84px;">
                <th>some table</th>
                <tr>
                    <td>&nbsp</td>
                </tr>
            </table>
        </td>
        <td align="center">
            some text blah blah blah    
        </td>
     </tr>
 </table>

一些桌子
 
一些文字废话

我认为你应该尝试设置你正在使用的每一列的宽度。这对你有用吗

更好的方法是:

<div style="float:left; width:100px; border:1px solid black">

Column 1 content

</div>


<div style="float:left; width:100px; border:1px solid black">

Column 2 content

</div>

第1栏内容
第2栏内容
从长远来看,你会很高兴换成div。:)


你能说得更具体一点,或者举个例子说明你想做什么吗?这个div很棒,但我需要它固定在左侧。我将在.net中使用gridview来显示右侧的div内容,这需要滚动,但我希望左侧保持不变。但我不希望在最小化浏览器时内容重叠。你的意思是像此网站左侧的反馈标签一样:如果你只想滚动gridview,您可以使其在右div标记内滚动。您的意思是不希望它只是自动调整右div的大小,而是希望滚动以保持高度恒定?
<div style="float:left; width:100px; border:1px solid black">

Column 1 content

</div>


<div style="float:left; width:100px; border:1px solid black">

Column 2 content

</div>