2009-02-13 11 views
0

Je travaille actuellement à la création d'une page Web à l'aide de .NET 2008. Nous obtenons des informations à partir d'une base de données et lorsque je les affiche, je n'arrive pas à les recouvrir. Par exemple:Enveloppement de mots sur une page Web

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

En 2233 comment puis-je pour aller en dessous pour ressembler à ceci:

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

Merci!

Répondre

1

Eh bien, il y a un meilleur moyen, mais cela peut être fait à peu de frais et rapidement avec des tables.

<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> 

Eh bien, j'ai essayé de l'implémenter dans markdown, mais ça ne l'a pas plu.

-Adam

3

Je structurer votre code HTML de la manière suivante:

<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> 

Et votre CSS serait la suivante:

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

tweak Il est évident que le nombre à votre goût: +1:

+0

+1: C'est la meilleure façon de faire allusion à ma réponse. CSS FTW! –

Questions connexes