DIV を使用してテーブルに似たものを作成しています。背景色を正しく表示するには、隣の高さに合わせて DIV を引き伸ばす必要があります。
これが私の例です:
<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Some title</title>
</head>
<body>
<div>
<div style="float:left; width: 49%; background-color: #ced6eb;">
Line1
<br/>
Line2
</div>
<div style="float:left; width: 49%; background-color: #dcddde; ">
Only one line here
</div>
<div style="clear: both;"></div>
</div>
<div>
<div style="float:left; width: 49%; background-color: #ced6eb;">
Something else
</div>
<div style="float:left; width: 49%; background-color: #dcddde;">
Something else
</div>
<div style="clear: both;"></div>
</div>
</body>
</html>
必要なのは、中央に空白行を入れるのではなく、右側の 3 行すべてに灰色の背景を設定することです。
これは私の HTML の簡易版です。左上の DIV (line1、line2) は可変長であるため、固定属性のようなものheight:30px
は受け入れられるソリューションではありません。
ありがとう !
イヴ