나는 css 수레에 표 내용을 넣는 방법을 배우려고합니다.bg color on row divs
"table"레벨, "row"레벨 및 "cell"레벨에서 div를 사용했습니다. 이것이 좋은 전략인지 확신하지 못합니다.
어쨌든 "테이블"또는 "셀"레벨에서 배경 스타일을 설정하면 색상이 변경 될 수 있습니다. 행 수준에서 설정하면 흰색으로 유지됩니다.
어떤 일이 벌어지고 있는지 추측 할 수 있습니까? 이 작업을 수행하는 더 좋은 방법이 있습니까?
<h2>"Tables" work</h2>
<div style="width: 455px; background-color:#a4c4fc">
<div>
<div style="width: 70px; float: left">ID</div>
<div style="width: 220px; float: left">Lemons</div>
<div style="width: 50px; float: left">Horseradish</div>
</div>
<br clear: both>
<div>
<div style="width: 70px; float: left">1<LEFT></div>
<div style="width: 220px; float: left">3</div>
<div style="width: 50px; float: left">4</div>
</div>
</div>
<br>
<h2>"Row" divs do not seem to work</h2>
<div style="width: 455px">
<div style="background-color:#a4c4fc">
<div style="width: 70px; float: left">ID</div>
<div style="width: 220px; float: left">Lemons</div>
<div style="width: 50px; float: left">Horseradish</div>
</div>
<br clear: both>
<div style="background-color:#a4c4fc">
<div style="width: 70px; float: left">0</div>
<div style="width: 220px; float: left">0</div>
<div style="width: 50px; float: left">1</div>
</div>
</div>
<br>
<h2>Individual cell divs work</h2>
<div style="width: 455px">
<div style="background-color:#a4c4fc">
<div style="width: 70px; float: left; background-color:#a4c4fc">ID</div>
<div style="width: 220px; float: left; background-color:#a4c4fc">Lemons</div>
<div style="width: 50px; float: left; background-color:#a4c4fc">Horseradish</div>
</div>
<br clear: both>
<div style="background-color:#a4c4fc">
<div style="width: 70px; float: left; background-color:#a4c4fc">0</div>
<div style="width: 220px; float: left; background-color:#a4c4fc">0</div>
<div style="width: 50px; float: left; background-color:#a4c4fc">1</div>
</div>
</div>
왜이 작업을 수행하려고합니까? 테이블은 테이블 컨텐츠에 완벽하게 수용됩니다. –
제가 말하고자하는 것은 이것이 테이블 기반 레이아웃에 대한 완전히 합법적 인 십자군의 잘못된 길 찾기가 아니길 바랍니다. 표는 의도 된 목적으로 사용될 때 유효하고 의미가있는 HTML입니다. –
@David : 숫자 값은 편집/삭제 버튼 등과 같은 것들의 자리 표시 자입니다. 레몬과 와사비는 또한 공연을위한 것입니다. 파벌/십자군, 정당에 흥미 롭습니다. – micahhoover