アプリ版:「スタンプのみでお礼する」機能のリリースについて

行き詰ってしまったのでこちらで質問させていただきます。

テーブルで表を作成しているのですが、
colspanで指定したセルの中にinputを入れると急にIE7でレイアウトが崩れます。
IEの他のverでは大丈夫なのですが、7だけくずれてしまうのは何か回避策があるのでしょうか?

ちなみに、下記のようなソースです。
全体で8列とり、1行目は項目3つに対してそれぞれinputを入れる列があり、
2行目は項目2つでinputを入れる列があります。
1行目は3等分にしたく、2行目は2等分にしたい形です。
何かほかに方法があるのでしょうか?
ご教授いただければと思います。

<style type="text/css">
.test{border-collapse:collapse;}
.test td,.test th{border:solid 1px #000;}
</style>


<table width="952" border="1" cellspacing="0" cellpadding="0" class="test">
<tr>
<th width="80">項目1</th>
<td width="235"><input name="" type="text" value="12345" /></td>
<th width="80">項目2</th>
<td colspan="3"><input name="" type="text" value="12345" /></td>
<th width="80">項目3</th>
<td width="235"><input name="" type="text" value="12345" /></td>
</tr>
<tr>
<th>項目4</th>
<td colspan="3"><input name="input2" type="text" value="12345" /></td>
<th width="80">項目5</th>
<td colspan="3"><input name="input3" type="text" value="12345" /></td>
</tr>
</table>

A 回答 (2件)

質問) DOCTYPEスイッチはどう書かれていますか??



>1行目は3等分にしたく、2行目は2等分にしたい形です。
 だと、2と3の公倍数のthとtdの倍、12等分して分けないと無理ですけど・・

★Another HTML Lint - Gateway( http://www.htmllint.net/html-lint/htmllint.html )
 のDATAで検証済みの、HTML4.01strict + CSS2.1
★IE7は、input要素へのスタイルが効かないが配置は同じになるはず

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="ja">
<head>
_<meta http-equiv="content-type" content="text/html; charset=Shift_JIS">
_<title>サンプル</title>
_<meta name="author" content="ORUKA1951">
_<meta http-equiv="Content-Style-Type" content="text/css">
_<link rev="made" href="mailto:oruka1951@hoge.com" title="send a mail" >
_<link rel="START" href="../index.html">
_<style type="text/css">
<!--
html,body{margin:0;padding:0;}
h1,h2,h3,h4,h5,h6{margin:0;line-height:1.6em;}
p{text-indent:1em;}
div.header,div.section,div.footer{width:90%;min-width:630px;max-width:900px;margin:0 auto;padding:5px;}
table[summary="form"]{
border-collapse:collapse;
line-height:2em;
}
table[summary="form"] tbody tr th,table[summary="form"] tbody tr td{
border:solid 1px;
position:relative;
}
table[summary="form"] tbody tr td input[type="text"]{margin:0;border:none;width:99%;}
table[summary="form"] tbody tr td input:focus{background-color:yellow;}
-->
_</style>
</head>
<body>
_<div class="header">
__<h1>タイトル</h1>
__<p>このページでは・・・・</p>
_</div>
_<div class="section">
__<h2>見出し</h2>
__<p>本文はsection</p>
__<table border="1" summary="form">
___<tbody>
____<tr>
_____<th abbr="Item1" width="80">項目1</th>
_____<td width="235"><input name="item1" type="text" value="12345"></td>
_____<th abbr="Item2" width="80">項目2</th>
_____<td colspan="3"><input name="item2" type="text" value="12345"></td>
_____<th abbr="Item3" width="80">項目3</th>
_____<td width="235"><input name="item3" type="text" value="12345"></td>
____</tr>
____<tr>
_____<th abbr="Item4" width="80">項目4</th>
_____<td colspan="3"><input name="input2" type="text" value="12345"></td>
_____<th abbr="Item1" width="80">項目5</th>
_____<td colspan="3"><input name="input3" type="text" value="12345"></td>
____</tr>
___</tbody>
__</table>
_</div>
_<div class="footer">
__<h2>文書情報</h2>
__<dl class="documentHistry">
___<dt id="FIRST-PUBLISHED">First Published</dt>
___<dd>2013-03-03</dd>
__</dl>
_</div>
</body>
</html>


 そんな無理なtabelではなくて、リストでマークアップしてスタイルシートで並べるほうが楽です。
    • good
    • 0
この回答へのお礼

ORUKA1951様、回答ありがとうございます。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitio …

を使用しております。
ORUKA1951様のを試してみたいと思います。
ありがとうございます!

お礼日時:2014/08/05 19:24

3等分と2等分の最小公倍数は6です。


6列にすればcolspanを使わなくていいです。


<table width="952" border="1" cellspacing="0" cellpadding="0" class="test">
<tr>
<th width="80">項目1</th>
<td width="235"><input name="" type="text" value="12345" /></td>
<th width="80">項目2</th>
<td width="235"><input name="" type="text" value="12345" /></td>
<th width="80">項目3</th>
<td width="235"><input name="" type="text" value="12345" /></td>
</tr>
<tr>
<th>項目4</th>
<td colspan="2"><input name="input2" type="text" value="12345" /></td>
<th width="80">項目5</th>
<td colspan="2"><input name="input3" type="text" value="12345" /></td>
</tr>
</table>
    • good
    • 0
この回答へのお礼

taloo様、返信ありがとうございます!

説明不足だったのですが、1行目の3分割は、ほぼ均等に3分割。
2行目の2分割はほぼ均等に2分割にしたいので、どこかの項目が大きく
なったりしないような形にしたいと思っております。
上記ですと、項目5が235とられてしまうので大きくなってしまうようです。

私のわかりずらい説明で申し訳ありません。
色々とためしてみたいと思います。

お礼日時:2014/08/06 10:09

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!