サイト内検索
...HTML・XHTMLタグ...
table・セル
セル内の折り返し禁止
- セル内の折り返しの禁止設定するには、td要素・th要素にnowrap属性を指定します。
- <br>を使うと、改行されます。
- [使い方]
- <table>
- <tr>
- <th nowrap></th>
- <td nowrap></td>
- </tr>
- </table>
- [メモ・・・W3Cの検証サービス・・・]
- HTML 4.01 Strict ・ XHTML1.0 Strict・XHTML1.1 では、推奨されていません。
- XHTML 4.01 Transitional ・ XHTML1.0 frameでは、
- <th nowrap="nowrap">と書きます。
サンプル(HTML 4.01 Transitional ・ HTML1.0 Frameset)
[bodyの中]
<table><tr>
<th nowrap>nowrapを使うと、改行させません。</th>
</tr>
<tr>
<td>No1</td>
</tr>
<tr>
<td>No2</td>
</tr>
<tr>
<td nowrap>nowrapを使うと、改行させません。</td>
</tr>
</table>
サンプル(XHTML 4.01 Transitional ・ XHTML1.0 frame)
[bodyの中]
<table><tr>
<th nowrap="nowrap">nowrapを指定すると、改行しません。</th>
</tr>
<tr>
<td>No1</td>
</tr>
<tr>
<td>No2</td>
</tr>
<tr>
<td nowrap="nowrap">nowrapを指定すると、改行しません。</td>
</tr>
</table>