IE のテーブルセルに width スタイルを指定する気力が失せる例 ― 2009年04月23日 11時13分33秒
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="content-style-type" content="text/css" />
<title>teble cell width test</title>
<style>
table {
width: 100%;
border-collapse: collapse;
}
table td, table th {
border: 1px solid #666;
}
table th {
width: 10ex;
background: #cef;
text-align: right;
padding-right: 1ex;
}
table td {
text-align: left;
padding-left: 2px;
}
</style>
</head>
<body>
<table>
<tr>
<th>name</th> <td colspan="3">T.MURACHI</td>
</tr>
<tr>
<th>age</th> <td>31</td>
<th>sex</th> <td>male</td>
</tr>
<tr>
<th>comment</th>
<td colspan="3">
Hi! I'm a fat programmer.
I like music, playing, listening, singing, and so on...
I own a company named "Harapeko Inc."
</td>
</tr>
</table>
</body>
</html>
- Firefox での表示例:
- Safari での表示例:
- IE7.0 での表示例:
結論: 神は死んだ。
…いや、とぼけている場合ではなくて、この現象、ネットでうまく検索することができないので、対策が分からずにいます。誰か教えて下さると有り難いデス…。





最近のコメント