c - Rakuten Inc
毎日1人に2000ポイントが当たる楽天ブログラッキーくじ
>>
人気記事ランキング
ブログを作成
楽天市場
674239
ホーム
|
日記
|
プロフィール
【フォローする】
【ログイン】
☆ Sanctuary ☆ Smile for you
TABLEタグ(3)
||
フリーページ一覧表へ戻る
||
TABLEタグ(2)へ
||
TABLEタグ(4)へ
||
テーブルタグ <table> の使い方を覚えよう!! (3)
table タグはページの作成に欠かせないものです。
table タグを使うと写真や文章などを縦横に整理して並べたりすることができます。
それでは table タグの便利な使い方を見てみましょう。。
● 表に罫線を引くには?
まず、TABLEタグ(2)のページで作成したものを振り返ってみましょう。
<table bgcolor="green" border="0" width="360" style="font-size:10pt;color:blue;">
<tr bgcolor="white">
<th width="180" align="center">ミャー子</td>
<th width="180" align="center">なな</td>
</tr>
<tr bgcolor="white">
<td width="180"><img src="http://plaza.rakuten.co.jp/img/user/98/02/1639802/47.jpg" width="180" height="135" alt="ミャー子"></td>
<td width="180"><img src="http://plaza.rakuten.co.jp/img/user/98/02/1639802/50.jpg" width="180" height="135" alt="なな"></td>
</tr>
<tr bgcolor="white">
<td width="180" align="left">ミャー子がお散歩中。。</td>
<td width="180" align="left">
ななが外で日向ぼっこして<br>います。</td></tr>
</table>
↓こんな感じでしたね。
ミャー子
なな
ミャー子がお散歩中。。
ななが外で日向ぼっこして
います。
( ・o・)b どうでしょう!!これでも罫線を引いているように見えませんか?
それでは、もうちょっとわかりやすくしてみましょう!
・table 全体の幅を 400 に広げ、
・各列の幅は 200 にしてみましょう!!
<table bgcolor="green" border="0"
width="400"
style="font-size:10pt;color:blue;">
<tr bgcolor="white">
<th
width="200"
align="center">ミャー子</td>
<th
width="200"
align="center">なな</td>
</tr>
<tr bgcolor="white">
<td
width="200"
><img src="http://plaza.rakuten.co.jp/img/user/98/02/1639802/47.jpg" width="180" height="135" alt="ミャー子"></td>
<td
width="200"
><img src="http://plaza.rakuten.co.jp/img/user/98/02/1639802/50.jpg" width="180" height="135" alt="なな"></td>
</tr>
<tr bgcolor="white">
<td
width="200"
align="left">ミャー子がお散歩中。。</td>
<td
width="200"
align="left">
ななが外で日向ぼっこして<br>います。</td></tr>
</table>
↓こんな感じになります。
ミャー子
なな
ミャー子がお散歩中。。
ななが外で日向ぼっこして
います。
( ・o・)b あれれ、写真が左に寄ってしまってますね。
それでは、 ・2行目を中央に寄せて、( align="center" )
・なおかつ2行目の、縦幅を 150 に広げて、 ( tr height="150" )
みましょう!!
<table bgcolor="green" border="0" width="400" style="font-size:10pt;color:blue;">
<tr bgcolor="white">
<th width="200" align="center">ミャー子</td>
<th width="200" align="center">なな</td>
</tr>
<tr bgcolor="white"
height="150"
>
<td width="200"
align="center"
><img src="http://plaza.rakuten.co.jp/img/user/98/02/1639802/47.jpg" width="180" height="135" alt="ミャー子"></td>
<td width="200"
align="center"
><img src="http://plaza.rakuten.co.jp/img/user/98/02/1639802/50.jpg" width="180" height="135" alt="なな"></td>
</tr>
<tr bgcolor="white">
<td width="200" align="left">ミャー子がお散歩中。。</td>
<td width="200" align="left">
ななが外で日向ぼっこして<br>います。</td></tr>
</table>
↓こんな感じになります。
ミャー子
なな
ミャー子がお散歩中。。
ななが外で日向ぼっこして
います。
( ・o・)b 罫線というからにはもうちょっと緑の部分を細くしたいですね。
それでは、table の cellspacing 属性を 1 にしてみましょう!!
cellspacing は列と列の隙間の幅を表します。
<table bgcolor="green" border="0"
cellspacing="1"
width="400" style="font-size:10pt;color:blue;">
<tr bgcolor="white">
<th width="200" align="center">ミャー子</td>
<th width="200" align="center">なな</td>
</tr>
<tr bgcolor="white" height="150">
<td width="200" align="center"><img src="http://plaza.rakuten.co.jp/img/user/98/02/1639802/47.jpg" width="180" height="135" alt="ミャー子"></td>
<td width="200" align="center"><img src="http://plaza.rakuten.co.jp/img/user/98/02/1639802/50.jpg" width="180" height="135" alt="なな"></td>
</tr>
<tr bgcolor="white">
<td width="200" align="left">ミャー子がお散歩中。。</td>
<td width="200" align="left">
ななが外で日向ぼっこして<br>います。</td></tr>
</table>
↓こんな感じになります。
ミャー子
なな
ミャー子がお散歩中。。
ななが外で日向ぼっこして
います。
( ^o^)b いかかでしょう!!これで罫線らしくなりましたね。
みなさんも罫線を引いたような表を作りたいなと思ったらこんな風にして見てくださいね。
table tag (3)
ジャンル別一覧
出産・子育て
ファッション
美容・コスメ
健康・ダイエット
生活・インテリア
料理・食べ物
ドリンク・お酒
ペット
趣味・ゲーム
映画・TV
音楽
読書・コミック
旅行・海外情報
園芸
スポーツ
アウトドア・釣り
車・バイク
パソコン・家電
そのほか
すべてのジャンル
© Rakuten Group, Inc.
X
共有
Facebook
Twitter
Google +
LinkedIn
Email
Create
a Mobile Website
スマートフォン版を閲覧
|
PC版を閲覧
人気ブログランキングへ
無料自動相互リンク
にほんブログ村 女磨き
LOHAS風なアイテム・グッズ
みんなが注目のトレンド情報とは・・・?
So-netトレンドブログ
Livedoor Blog a
Livedoor Blog b
Livedoor Blog c
JUGEMブログ
Excitブログ
Seesaaブログ
Seesaaブログ
Googleブログ
なにこれオシャレ?トレンドアイテム情報
みんなの通販市場
無料のオファーでコツコツ稼ぐ方法
無料オファーのアフィリエイトで稼げるASP
評判のトレンドアイテム情報
Hsc
人気ブログランキングへ
その他
Share by: