罫線の設定方法について

お世話になっております。

HTMLで表を作成しているのですが、罫線の太さを画像(エクセル)のようにしたいと考えております。

上のみや外枠全体は検索すると出てくるのですが行いたい形が検索しても出てこず、時間ばかりが過ぎてしまっている状態です。

どなたかご教授して頂けないでしょうか。

 

 

(作りたい形)

 

 

(HTML)

<div id='custom'>
  <table border="1" style="border-collapse: collapse"  align="center" }>

    <tbody>

      <tr>
        <th colspan="3">ビル名</th>
        <th colspan="11">住所</th>

      </tr>
      <tr>
        <td colspan="3">&nbsp;</td>
        <td colspan="11">&nbsp;</td>

      </tr>
      <tr>
        <th>延べ面積</th>
        <th>建築面積</th>
        <th>敷地面積</th>
        <th>階/号数</th>
        <th>入居者/テナント名</th>
        <th>契約者名</th>
        <th>契約面積</th>
        <th width="70">賃料</th>
        <th width="70">㎡単価</th>
        <th>管理/共益費</th>
        <th>看板料等他</th>
        <th width="120">敷金/保証金</th>
        <th>合計収益</th>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th>契約面積合計</th>
        <th>敷/保証金合計</th>
        <th>管理/共益費合計</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>

      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th>賃料合計</th>
        <th>看板料等他合計</th>
        <th>合計収益</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th>空き部屋</th>
        <th colspan="2">ビル図面</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td colspan="2">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th>メモ欄</th>
        <td colspan="2">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
  </table>
</div>

nekokoさん

こんにちは。

 

「上のみや外枠全体は検索すると出てくる」というところまで調査されているとのことで

あとはそれらを組み合わせれば、ご希望の形になると思います。

 

外枠四辺を太くするならば、style=“border-width: 3px;” を付けます。

<tableborder="1"style="border-collapse: collapse; border-width: 3px;"align="center">

 

下辺を太くするならば、style=“border-bottom-width: 3px;” を付けます。

<th colspan="3" style="border-right-width: 3px; border-bottom-width: 3px;">ビル名</th>
<th colspan="11" style="border-bottom-width: 3px;">住所</th>

 

右辺を太くするならば、style=“border-right-width: 3px;” を付けます。

<th style="border-right-width: 3px;">敷地面積</th>

 

上辺を太くするならば、style=“border-top-width: 3px;” を付けます。

<td style="border-top-width: 3px;">&nbsp;</td>

 

このように太くしたいタグごとにstyleを追加してあげると良いです。

3pxは太さなので、お好みで変えてください。

 

CSSを使えば、n番目のtdタグのstyleを設定する、なんてことができますので

HTMLは変えずに、CSSだけ必要に応じて修正していくといったこともできます。

もう少し汎用性の高い書き方ができると思います。

koichi様

お世話に

お世話になっております。

ご返信遅れて申し訳ございません。

 

各コードのご提示ありがとうございます。

n番目のタグを変更したいのでCSSのコード書いてみようと思います。

 

ありがとうございました。