0

現在、.NET 2008 を使用して Web ページの作成に取り組んでいます。データベースから情報を取得していますが、それを表示するときに下に折り返すことができません。例えば:

 2231 Question 1
 2232 Mechanical Engineering Technologists and Technicians 
 2233 Industrial Engineering and Manufacturing Technologists 
 and Technicians 
 2234 Question 4 

2233 では、下に移動して次のようにするにはどうすればよいですか。

 2231 Question 1
 2232 Mechanical Engineering Technologists and Technicians 
 2233 Industrial Engineering and Manufacturing Technologists 
      and Technicians 
 2234 Question 4 

ありがとうございました!

4

2 に答える 2

3

次の方法で HTML を構成します。

<div class="qNumber">2231</div>
<div class="qContent">Question 1</div>
<div class="clear"></div>

<div class="qNumber">2232</div>
<div class="qContent">Mechanical Engineering Technologists and Technicians</div>
<div class="clear"></div>

<div class="qNumber">2233</div>
<div class="qContent">Industrial Engineering and Manufacturing Technologists and Technicians </div>
<div class="clear"></div>

<div class="qNumber">2234</div>
<div class="qContent">Question 4</div>
<div class="clear"></div>

CSS は次のようになります。

.qNumber { float: left; width: 40px; }
.qContent { width: 350px; padding-left: 40px; }
.clear { clear: both; }

明らかにあなたの好みに合わせて数を微調整してください:)

于 2009-02-13T18:59:12.460 に答える
1

もっと良い方法がありますが、これはテーブルを使って安価かつ迅速に行うことができます。

<table>
<tr><td>2231</td><td>Question 1</td></tr>
<tr><td>2232</td><td>Mechanical Engineering Technologists and Technicians</td></tr> 
<tr><td>2233</td><td>Industrial Engineering and Manufacturing Technologists and Technicians</td></tr> 
<tr><td>2234</td><td>Question 4</td></tr>
</table>

まあ、マークダウンで実装しようとしましたが、気に入らなかったです。

-アダム

于 2009-02-13T18:46:22.943 に答える