サイト内検索

...スタイルシート(css)...

スタイルシート・table

セル内の改行

セル内の空白や折り返しは、white-spaceプロパティを指定します。
改行・半角スペース・タブ行送りなどの
空白・折り返しをどのようにするかを指定します。
主に、折り返しを指定します。
[使い方]
td.sample{
white-space: nowrap;
}
プロパティ名 説明
white-space: nowrap;自動的に改行されない。
normal;ボックスの大きさに応じて
自動的に改行されます。

サンプル

[headの中]

<style type="text/css">
<!--
table{
border: 1px #999999 solid;
width: 200px;
}
th, td{
padding: 30px;
border: 1px #999999 solid;
}
td.sample1{
white-space: nowrap;
}
-->
</style>

[bodyの中]

<table>
<tr>
<th class="sample1"> white-space:nowrap; </th>
<th> white-space:normal;</th>
</tr>
<tr>
<td class="sample1"> white-space:nowrap; </td>
<td> white-space:normal;</td>
</tr>
</table>

[ブラウザ上]

white-space:nowrap; white-space:normal;
white-space:nowrap; white-space:normal;

Copyright c 2007.10.01 luc All rights reserved.