Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
<html lang="en-US">
<title>Table background tests</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
html, body { margin: 0; padding: 0; border: 0; font-size: 16px; }
body { padding: 15px; }
.o { opacity: 0.5; }
table {
margin: 0px 3px 2px 4px;
border-width: 4px 2px 8px 6px;
height is 97px:
(2px of border outside height)
extra border width for top row: 0
cell * 5: == 19px * 5 == 95px
border-top: 2px;
padding-top: 1px;
height: 10px;
padding-bottom: 4px;
border-bottom: 2px;
extra border width for top row: 2px
(4px of border outside height)
width is 287px:
(3px of border outside width)
extra border width for left column: 2px
cell * 5: == 57px * 5 == 285px
border-left: 1px;
padding-left: 3px;
width: 50px;
padding-right: 2px;
border-right: 1px;
(1px of border outside width)
div { width: 57px; height: 19px; margin: 40px 118px 86px 123px; }
div.color { background-color: aqua; }
/* The use of opacity < 1 on this cell will create a stacking context,
which causes its background to be inset inside the (collapsed) borders,
see bug 1859523. Adjust the reference div to match. */
div.color.o { width: 55px; height: 15px; margin: 42px 119px 88px 124px; }
div.imagetl, div.imagebr {
background-image: url(repeatable-diagonal-gradient-with-ticks.png);
div.imagetl { background-position: 1px 2px; }
div.imagebr { background-position: 56px 17px; }
<div class="color o"></div>
<div class="imagetl o"></div>
<div class="imagebr"></div>