目次ページ 前のページ 次のページ

HTML文書 作成の手引き

7. 表の作成と応用


7.2 表の作成にはテンプレートを使う

 一般的な表を組み上げるようにソーステキストを作成するのはかなり面倒です。主要な注意は、見栄え良く作成するための列幅の寸法定義です。実践的には、Wordの画面でレイアウトを作成しておいて、HTMLファイルに落としたテキストファイルの原稿を修正することです。このとき、表のテキスト並びを制御するタグの組み立てが、下のようになっていることを理解しておきます。これは、列幅指定をピクセル数で指定した場合と%指定をしたときの比較です。このどちらも、IEの表示画面で、ウインドウの横幅を変化させると、列幅も相対的に変化し、文字幅に対してセル幅が狭くなると、文字列はセル内で自動改行されます。

表8 A4用紙を縦位置にして横書きにするときのスタイル
<table border>
<caption>表…幅指定がピクセル </caption>
       <tr>
         <td width=160>&nbsp;</td>
         <td width=160>&nbsp;</td>
         <td width=160>&nbsp;</td>
         <td width=160>&nbsp;</td>
       </tr>
 
       <tr>
         <td width=160>&nbsp;</td>
         <td width=160>&nbsp;</td>
         <td width=160>&nbsp;</td>
         <td width=160>&nbsp;</td>
       </tr>

       <tr>
         <td width=160>&nbsp;</td>
         <td width=160>&nbsp;</td>
         <td width=160>&nbsp;</td>
         <td width=160>&nbsp;</td>
       </tr>
     </table> 
<table border>
<caption>表…幅指定が% </caption>
       <tr>
         <td width=20%>&nbsp;</td>
         <td width=20%>&nbsp;</td>
         <td width=20%>&nbsp;</td>
         <td width=20%>&nbsp;</td>
       </tr>
 
       <tr>
         <td width=20%>&nbsp;</td>
         <td width=20%>&nbsp;</td>
         <td width=20%>&nbsp;</td>
         <td width=20%>&nbsp;</td>
       </tr>

       <tr>
         <td width=20%>&nbsp;</td>
         <td width=20%>&nbsp;</td>
         <td width=20%>&nbsp;</td>
         <td width=20%>&nbsp;</td>
       </tr>
     </table> 
科学書刊株式会社:電子版 「橋梁&都市 PROJECT: 2011」

前のページ  次のページ