2011-12-21 2 views
0

私はテーブルが2つあります。左の列は、デフォルトでは縦に中央に表示されているようです。私の代わりに、すべてのコンテンツをトップ揃えたいのですが:表のセルの上部に配置されたコンテンツ

--------------------------- 
|   | words words | 
| apples | words words | 
|   | words words | 
--------------------------- 

うんどのように私が代わりにその内容をトップ揃えるに0番目の列を得ることができますか?

<table width="100%"> 
<tr> 
    <td>apples</td> 
    <td>words words ....</td> 
</tr> 
</table> 

おかげ

答えて

0

スタイル= "垂直整列

テーブルVALIGN = "トップ" 幅= "100%"

または

をお試しください:上;"

0

あなたはこのコードを試すことができます。

<table width="100%"> 
<tr> 
    <td align="center" valign="top">apples</td> 
    <td>words words words words words words words words</td> 
</tr> 
</table> 

enter image description here

0

HTMLの方法が<tr valign=top><tr>を交換することです。 valign属性は個々のセルでも使用できますが、テーブル全体では使用できません(少なくともスペックによって)。

CSSの方法は、vertical-alignプロパティを使用することです。たとえば、文書内のすべての表セルに適用するには、

<style> 
th, td { vertical-align: top; } 
</style> 
を使用します。
関連する問題