1. ホーム
  2. Web制作
  3. HTML/Xhtml

HTMLテーブル テーブルボーダー制御の詳細

2022-01-16 14:54:19
上部のボーダーだけを表示する <table frame=above>
下のボーダーのみを表示する <table frame=below>
左右のフレームのみを表示する <table frame=vsides>
上下のボーダーのみを表示する <table frame=hsides>
左ボーダーのみを表示する <table frame=lhs>
右フレームのみ表示する <table frame=rhs>
ボーダーを表示しない <table frame=void>
コピーコード
コードは以下の通りです。

<html>
<head>
<title>Form border hiding</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
body { color:"#ffffff";
font-family: "宋体";
font-size: 12px;
margin-top : 4;
}
.t {
border: #000000; border-style: solid; border-width: 1px
}
td {
font-family: "Tahoma", "MS Shell Dlg"; font-size: 12px
}
textarea {border: 1 solid #000000"}
</style>
</head>
<body bgcolor="#999999" text="#000000">
<center>
<table width="600" border="0" cellspacing="0" cellpadding="8" class="t">
<tr>
<td>
<table border="1" width="200" cellpadding="0" cellspacing="0">
<tr align="center">
<td>pu</td>
<td>table</td>
</tr>
<tr align="center">
<td>pass</td>
<td>g</td>
</tr>
</table>
</td>
<td> This is a common form</td>
</tr>
<tr>
<td>
<table width="200" border="1" cellspacing="0" cellpadding="0" frame=above>
<tr align="center">
<td>header</td>
<td>up</td>
</tr>
<tr align="center">
<td>there</td>
<td>days</td>
</tr>
</table>
</td>
<td> Show top border only</td>
</tr>
<tr>
<td>
<table width="200" border="1" cellspacing="0" cellpadding="0" frame=below>
<tr>
<td align="center">feet</td>
<td align="center">down</td>
</tr>
<tr>
<td align="center">there</td>
<td align="center">ground</td>
</tr>
</table>
</td>
<td> Show lower border only</td>
</tr>
<tr>
<td>
<table width="200" border="1" cellspacing="0" cellpadding="0" frame=vsides>
<tr>
<td align="center">Up Without a Sky</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="center">Down to nowhere</td>
</tr>
</table>
</td>
<td> Show only the left and right boxes</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0" cellpadding="0" frame=hsides width="200">
<tr>
<td align="center"> remove both sides</td>
<td></td>
</tr>
<tr>
<td></td>
<td align="center">Only the word "king" remains</td>
</tr>
</table>
</td>
<td> Show top and bottom borders only</td>
</tr>
<tr>
<td>
<table width="200" border="1" cellspacing="0" cellpadding="0" frame=lhs>
<tr>
<td width="100" align="center">only</td>
<td width="100" align="center">there</td>
</tr>
<tr>
<td align="center">left</td>
<td align="center">side</td>
</tr>
</table>
</td>
<td> Show left border only</td>
</tr>
<tr>
<td>
<table width="200" border="1" cellspacing="0" cellpadding="0" frame=rhs>
<tr>
<td width="100" align="center">only</td>
<td width="100" align="center">there</td>
</tr>
<tr>
<td align="center">right</td>
<td align="center">side</td>
</tr>
</table>
</td>
<td> Show right box only</td>
</tr>
<tr>
<td>
<table width="200" border="1" cellspacing="0" cellpadding="0" frame=void>
<tr>
<td align="center">four weeks</td>
<td align="center">remove</td>
</tr>
<tr>
<td align="center"> Only stay</td>
<td align="center">middle</td>
</tr>
</table>
</td>
<td> Does not show any borders</td>
</tr>
<tr>
<td colspan="2">
<hr size="1" color=black>
The display and hiding of the table borders is controlled with the frame parameter. Please note that it only controls the border image of the table, not the cells.
Show only the top border &lt;table frame=above&gt;
Show only the bottom frame &lt;table frame=below&gt;
Show left and right frames only &lt;table frame=vsides&gt;
Show only top and bottom borders &lt;table frame=hsides&gt;
Show left border only &lt;table frame=lhs&gt;
Show right frame only &lt;table frame=rhs&gt;
Show no borders &lt;table frame=void&gt;</td>
</tr>
</table>
</center>
</body>
</html>