テーブルの枠線で

[新着] Webテンプレートを仮オープンしました



0   名前: miki : 2004/06/08 10:53
お世話になります。

表の罫線で各線がそれぞれに違うものにしたいのです。
たとえば上横線は1ピクセル、下横線はなし、たて線は左から15ピクセル、1ピクセル、なし、と言う様な
表を作りたいのですが、うまくいきません。cellspacing="1"です。
初心者に分かるように教えていただけないでしょうか。

1   名前: ばあど : 2004/06/08 11:19   [URL
スタイルシートは分かる?
例えば・・・
<table>
<tr>
<td style="border:7px solid #f00">あいうえお</td>
<td style="border:11px double #0f0">かきくけこ</td>
</tr>
<tr>
<td style="border:5px dotted #00f">さしすせそ</td>
<td style="border:2px groove #660">たちつてと</td>
</tr>
</table>

2   名前: miki : 2004/06/08 14:44
早速ありがとうございました。
スタイルシートをよく分からないまま使ってみました。お蔭様でイメージに近くなったと思います。

<TABLE align="center" bgcolor=#ffffff STYLE="border-top: 1px #C0C0C0 solid; border-right: none; border-bottom: none; border-left: none; width: 400px; height: 100px;">
<TR>
<TD STYLE="border-top: none; border-right: none; border-bottom: none; border-left: 10px #C0C0C0 solid; width: 200px; height: 100px;">セル1</TD>
<TD STYLE="border-top: none; border-right: none; border-bottom: none; border-left: 1px #C0C0C0 dotted; width: 200px; height: 100px;">セル2</TD>
</TR></TABLE>
この表を1ページの中にいくつか使いたいのでhead部分に記述し、各表毎に左縦線の10px #C0C0C0の色を変えたいのですがどう記述していいか分かりません。
よろしくおねがいします。

3   名前: Sinryow : 2004/06/08 16:04   [URL
すべての枠に共通のスタイルは,head部分に書いてクラスを適用します。
各枠で異なるスタイルだけ(この場合は線の色)を style="〜" で指定すればよいです。
この場合だと,多分

<html>
<head>
<style type="text/css"><!--
td.cells{
border-top: none;
border-right: none;
border-bottom: none;
width: 200px;
height: 100px;
}
--></style>
</head>
<body>
<table align="center" bgcolor=#ffffff style="border-top: 1px #C0C0C0 solid; border-right: none; border-bottom: none;

border-left: none; width: 400px; height: 100px;">
<tr>
<td class="cells" style="border-left: 10px #C0C0C0 solid;">セル1</td>
<td class="cells" style="border-left: 1px #C0C0C0 dotted;">セル2</td>
</tr>
</table>
</body>
</html>

このような感じでしょう。

4   名前: miki : 2004/06/08 16:54
Sinryowさん、ありがとうございます。
おかげさまで、うまく出来ました。

一覧へ戻る