以下のような表を作成しました。
https://jsfiddle.net/h9ehqw55/
上記では表にスクロールが表示されますが、
IEでhtmlを組むとスクロールが表示されません。
Chromeではスクロールが表示されます。
いろいろ試してみたのですが、
どうやっても上記で作成した表のスクロールがIEでは消えてしまいます。
解決方法ありましたら宜しくお願いします。
「追記」※styleとborderの個所を削除しております。
以下のようにjQueryプラグインを使用しようとしていますが、おかしな点はありますでしょうか?
現状はなぜか、
thead_height: '30px',の箇所や、
$strHTML = '<table id="tbl_list" cellspacing="0" cellpadding="0" >
の箇所でsyntax errorが出力されてしまいます。
$strHTML = '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="description" content="テスト"> <title>tbodyScroll - jQueryプラグイン</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <script src="jquery.tbodyscroll.js"></script> <script> $(document).ready(function() { $('.demo').tbodyScroll({ thead_height: '30px', tbody_height: '100px', head_bgcolor: 'transparent', foot_bgcolor: 'transparent' }); }); </script> <style> th,td {width: 180px;} </style> </head> //ヘッダー部 $strHTML = '<table id="tbl_list" cellspacing="0" cellpadding="0" > <thead> <tr> <th scope="col" class="f-weight" >'.((!empty($lent_ichran)) ? "レンタル":'').'管理番号</th> <th scope="col" class="f-weight" >メーカー名</th> <th scope="col" class="f-weight" >シリアルNo</th> </tr> </thead> '; $strHTML .= "<tbody >"; if ($datanum > 0) { while ($CN->EOF() == true) { //データ部 $strHTML .= "<tr ".$bgcolor."> <td class='break' >"._hs($CN->GetFieldData('kanri_no'))."</td> <td class='break' >"._hs($CN->GetFieldData('maker_name'))."</td> <td class='break' >"._hs($CN->GetFieldData('maker_serial'))."</td> </tr>"; $CN->MoveNext(); } } else { $strHTML .= "<tr><td colspan='28'>該当するデータがありません。</td></tr>"; } $CN->DBClose(); $strHTML .= "</tbody> </table>"; </html> ';
「追記」
修正しましたが、$(document).ready(function() {の箇所で
syntax error, unexpected '('と怒られます。なぜでしょうか。
ほかにもおかしな箇所ありましたらご教授ください。
$strHTML = '<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="description" content="テスト"> <title>tbodyScroll - jQueryプラグイン</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <script src="jquery.tbodyscroll.js"></script> <script> '; $(document).ready(function() { $(".demo").tbodyScroll({ thead_height: "30px", tbody_height: "100px", head_bgcolor: "transparent", foot_bgcolor: "transparent" }); }); $strHTML = '</script> <style> th,td {width: 180px;} </style> </head>'; //ヘッダー部 $strHTML = '<table id="tbl_list" cellspacing="0" cellpadding="0" > <thead> <tr> <th scope="col" class="f-weight" >'.((!empty($lent_ichran)) ? "レンタル":'').'管理番号</th> <th scope="col" class="f-weight" >メーカー名</th> <th scope="col" class="f-weight" >シリアルNo</th> </tr> </thead> '; $strHTML .= "<tbody >"; if ($datanum > 0) { while ($CN->EOF() == true) { //データ部 $strHTML .= "<tr ".$bgcolor."> <td class='break' >"._hs($CN->GetFieldData('kanri_no'))."</td> <td class='break' >"._hs($CN->GetFieldData('maker_name'))."</td> <td class='break' >"._hs($CN->GetFieldData('maker_serial'))."</td> </tr>"; $CN->MoveNext(); } } else { $strHTML .= "<tr><td colspan='28'>該当するデータがありません。</td></tr>"; } $CN->DBClose(); $strHTML .= "</tbody> </table>"; </html> ';
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/03/07 01:40
2018/03/07 04:49
2018/03/07 04:53
2018/03/07 07:13 編集
2018/03/07 07:13 編集
2018/03/07 07:22 編集
2018/03/07 07:38 編集
2018/03/07 08:20
2018/03/07 08:43
2018/03/08 00:42 編集
2018/03/08 00:42 編集
2018/03/09 11:07