私はJQueryを使用しています。テーブルの列を非表示にする必要があります(divベース)。次の例では、チェックボックスをクリックしてテキストボックスを非表示/表示する必要があります。テキスト ボックスを非表示にした後、段落 2 が上に移動します。同じで、顧客名と住所の位置を変更する必要はありません。
HTMLコードは
<input type="checkbox" id="chk" />Check it, if customer has no company.
<span>Paragraph 1st Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum </span>
<div class="divTable">
<div class="headRow">
<div class="divCell" align="center">Company Name</div>
<div class="divCell">Customer Name</div>
<div class="divCell">Customer Address</div>
</div>
<div class="divRow">
<div class="divCell" align="center"><input type="text" /></div>
<div class="divCell" align="center">Customer Name</div>
<div class="divCell" align="center">Customer Address</div>
</div>
<div class="divRow">
<div class="divCell" align="center"><input type="text" /></div>
</div>
<div class="divRow">
<div class="divCell" align="center"><input type="text" /></div>
</div>
</div>
<p>Paragraph 2nd Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum </P>
CSSは、
.divTable
{
display: table;
width:auto;
background-color:#eee;
border:1px solid #666666;
border-spacing:5px;
}
.divRow
{
display:table-row;
width:auto;
}
.divCell
{
float:left;
display:table-column;
width:200px;
background-color:#ccc;
}
テーブルの列を非表示にするにはどうすればよいですか (div ベース)?