D
Dennis Marks
Following is simple HTML with CSS to create a 4x4 table. It is just an
experiment to replace a table. My question is: can the CSS be reduced?
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="EN">
<head>
<title>CSS Table</title>
<style type="text/css">
div {position: absolute; height: 25%; width: 25%; border-style: solid; }
#a1 {left: 0%; top: 0%;}
#a2 {left: 25%; top: 0%;}
#a3 {left: 50%; top: 0%; }
#a4 {left: 75%; top: 0%;}
#b1 {left: 0%; top: 25%;}
#b2 {left: 25%; top: 25%;}
#b3 {left: 50%; top: 25%;}
#b4 {left: 75%; top: 25%;}
#c1 {left: 0%; top: 50%;}
#c2 {left: 25%; top: 50%;}
#c3 {left: 50%; top: 50%;}
#c4 {left: 75%; top: 50%;}
#d1 {left: 0%; top: 75%;}
#d2 {left: 25%; top: 75%;}
#d3 {left: 50%; top: 75%;}
#d4 {left: 75%; top: 75%;}
</style>
</head>
<body >
<div id="a1">a1</div>
<div id="a2">a2</div>
<div id="a3">a3</div>
<div id="a4">a4</div>
<div id="b1">b1</div>
<div id="b2">b2</div>
<div id="b3">b3</div>
<div id="b4">b4</div>
<div id="c1">c1</div>
<div id="c2">c2</div>
<div id="c3">c3</div>
<div id="c4">c4</div>
<div id="d1">d1</div>
<div id="d2">d2</div>
<div id="d3">d3</div>
<div id="d4">d4</div>
</body>
</html>
experiment to replace a table. My question is: can the CSS be reduced?
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="EN">
<head>
<title>CSS Table</title>
<style type="text/css">
div {position: absolute; height: 25%; width: 25%; border-style: solid; }
#a1 {left: 0%; top: 0%;}
#a2 {left: 25%; top: 0%;}
#a3 {left: 50%; top: 0%; }
#a4 {left: 75%; top: 0%;}
#b1 {left: 0%; top: 25%;}
#b2 {left: 25%; top: 25%;}
#b3 {left: 50%; top: 25%;}
#b4 {left: 75%; top: 25%;}
#c1 {left: 0%; top: 50%;}
#c2 {left: 25%; top: 50%;}
#c3 {left: 50%; top: 50%;}
#c4 {left: 75%; top: 50%;}
#d1 {left: 0%; top: 75%;}
#d2 {left: 25%; top: 75%;}
#d3 {left: 50%; top: 75%;}
#d4 {left: 75%; top: 75%;}
</style>
</head>
<body >
<div id="a1">a1</div>
<div id="a2">a2</div>
<div id="a3">a3</div>
<div id="a4">a4</div>
<div id="b1">b1</div>
<div id="b2">b2</div>
<div id="b3">b3</div>
<div id="b4">b4</div>
<div id="c1">c1</div>
<div id="c2">c2</div>
<div id="c3">c3</div>
<div id="c4">c4</div>
<div id="d1">d1</div>
<div id="d2">d2</div>
<div id="d3">d3</div>
<div id="d4">d4</div>
</body>
</html>