0
よろしくお願いいたします。以下のコードで私はいくつかの偽のデータ値を持っています。私は150pxを述べたように固定するのではなく、カップル以上の文字を追加すると、画面の実際の幅が変わるようです。固定するには幅が必要です。私がこれを保証するために設定できるプロパティはありますか?HTMLテーブルヘッダーの幅は比例幅に応じてサイジングされているようですか?
<div id='DataTable' style='height:300px;overflow:auto;overflow-x:auto;overflow-y:scroll;width:900px;' onmouseup="MatchScroll('DataTable','HeaderTable', true);" onmousemove="MatchScroll('DataTable','HeaderTable', false);" >
<table border='1' style='width:2850px;'>
<tbody id='ClearDetails'>
<tr id='Row0' style='color:black;height:auto;'>
<td style='width:150px;'>testtttt</td>
<td style='width:150px;'>te</td>
<td style='width:150px;'>test</td>
<td style='width:150px;'>test</td>
<td style='width:150px;'>t</td>
<td style='width:150px;'>test</td>
<td style='width:150px;'>test</td>
<td style='width:150px;'>testtttttt</td>
<td style='width:150px;'>test</td>
<td style='width:150px;'>test</td>
<td style='width:150px;'>test</td>
<td style='width:150px;'>test</td>
<td style='width:150px;'>test</td>
<td style='width:150px;'>test</td>
<td style='width:150px;'>test</td>
<td style='width:150px;'>test</td>
<td style='width:150px;'>test</td>
<td style='width:150px;'>test</td>
<td style='width:150px;'>test</td>
</tr>
</tbody>
</table>
hrefタグにdisplay:blockを含めることで動作するように思えました。唯一の問題は、データ(hrefタグを持たないデータ)が固定幅である必要があることです。 – Tom
コードを見ると、あまり意味がありません。 まず、幅900pxのdivを作成します。次に、テーブルに最大幅2850ピクセルの列があり、列にはそれぞれ150ピクセルの束があります。あなたの心を整える:-) fyi、テーブルには「
」があり、は 'display:block'にしないでください。これはすべてのブラウザで同じように動作しないからです。 – cypher関連する問題