3

私はいくつかの異なるテーブルを持っています<input type = 'text'>。長さは 64 文字、7 文字、4 文字にする必要があります。幸いなことに、それらはすべてグループ化されているため、これを行う最善の方法は、セクションごとに複数の div タグを使用することです。ただし、CSS で幅を調整しようとしても、入力が変化しません。何を与える?外部CSSがあります。テーブルコードとCSSコードは以下です

余談ですが、私は 64px != 64 文字であることを認識しています

編集: HTML コードの動作を修正しました。

テーブル:

<?php
    require_once('auth.php');
    //Include database connection details
    require_once('config.php');
  ?>

    <html>
      <head>
        <title>Edit Profile</title>
        <link rel = 'stylesheet' type = 'text/css' href = 'default.css' />
      </head>
    <body>
      <div id = 'sideContainer'>
        <div id = 'navMain'>
          <?php include 'sidebar.html'; ?>
        </div>
      </div>
      <div id = 'content'>
        <?php
          $memberID = $_SESSION['SESS_MEMBER_ID'];
          $query = "SELECT * FROM memberData WHERE member_ID = '$memberID'";
          $result = mysql_query($query);
          while($row = mysql_fetch_assoc($result)){
            $vCode = $row['vCode'];
            $keyID = $row['keyID'];
            $mlYeild = $row['mlYeild'];
            $cycleTime = $row['cycleTime'];
            $veld = $row['veld'];
            $scor = $row['scor'];
            $pyro = $row['pyro'];
            $plag = $row['plag'];
            $omber = $row['omber'];
            $kern = $row['kern'];
            $jas = $row['jas'];
            $hemo = $row['hemo'];
            $gneiss = $row['gneiss'];
            $ochre = $row['ochre'];
            $spod = $row['spod'];
            $crok = $row['crok'];
            $bistot = $row['bistot'];
            $ark = $row['ark'];
            $merc = $row['merc'];

          }
        ?>
        <form id = 'editPlayerInfo' name = 'editPlayerInfo' method = 'post' action = 'editUser-exec.php'>
          <table border = '0'>
            <tr>
              <td colspan = '2'><h2>API stuff</h2></td>
            </tr>
            <tr>
              <td><h3>vCode</h3></td>
              <td><div id = 'vCode'><input type = 'text' name = 'vCode' value = '1234567812345678123456781234567812345678123456781234567812345678'></div></td>
            </tr>
            <tr>
              <td><h3>keyID</h3></td>
              <td><div id = 'keyID'><input name = 'keyID' type = 'text' value = '<?php echo $keyID; ?>'></div>
              </td>
            </tr>
          </table>
          <HR>
          <div id = 'refining'>
            <table>
              <tr>
                <td colspan  = '4'><h2>Mining Laser stuff</h2></td>
              </tr>
              <tr> 
                <td><h3>Mining Laser Yeild</h3></td>
                <td><input name = 'mlYeild' type = 'text' class = 'textfield' id = 'mlYeild' value = '<?php echo $mlYeild; ?>'/></td>
              </tr>
              <tr>
                <td><h3>Cycle Time</h3></td>
                <td><input name = 'cycleTime' type = 'text' class = 'textfield' id = 'cycleTime' value = '<?php echo $cycleTime; ?>'/></td>
              </tr>
            </table>
            <HR>
            <table>
              <tr>
                <td colspan  = '6'><h2>Yeild Specifics</h2></td>
              </tr>
                <td><h3>Veldspar Yeild</h3></td>
                <td><input name = 'veldYeild' type = 'text' class = 'textfield' id = 'veldYeild' value = '<?php echo $veld; ?>'/></td>
                <td><h3>Scordite Yeild</h3></td>
                <td><input name = 'scorYeild' type = 'text' class = 'textfield' id = 'scorYeild' value = '<?php echo $scor; ?>'/></td>
                <td><h3>Pyroxeres Yeild</h3></td>
                <td><input name = 'pyroYeild' type = 'text' class = 'textfield' id = 'pyroYeild' value = '<?php echo $pyro; ?>'/></td>            
              </tr>
              <tr>
                <td><h3>Plagioclase Yeild</h3></td>
                <td><input name = 'plagYeild' type = 'text' class = 'textfield' id = 'plagYeild' value = '<?php echo $plag; ?>'/></td>
                <td><h3>Omber Yeild</h3></td>
                <td><input name = 'omberYeild' type = 'text' class = 'textfield' id = 'omberYeild' value = '<?php echo $omber; ?>'/></td>
                <td><h3>Kernite Yeild</h3></td>
                <td><input name = 'kernYeild' type = 'text' class = 'textfield' id = 'kernYeild' value = '<?php echo $kern; ?>'/></td>
              </tr>
              <tr>
                <td><h3>Jaspet Yeild</h3></td>
                <td><input name = 'jasYeild' type = 'text' class = 'textfield' id = 'jasYeild' value = '<?php echo $jas; ?>'/></td>
                <td><h3>Hemorphite Yeild</h3></td>
                <td><input name = 'hemYeild' type = 'text' class = 'textfield' id = 'hemYeild' value = '<?php echo $hemo; ?>'/></td>
                <td><h3>Gneiss Yeild</h3></td>
                <td><input name = 'gneissYeild' type = 'text' class = 'textfield' id = 'gneissYeild' value = '<?php echo $gneiss; ?>'/></td>          
              </tr>
              <tr>
                <td><h3>Dark ochre Yeild</h3></td>
                <td><input name = 'ochreYeild' type = 'text' class = 'textfield' id = 'ochreYeild' value = '<?php echo $ochre; ?>'/></td>
                <td><h3>Spodumain Yeild</h3></td>
                <td><input name = 'spodYield' type = 'text' class = 'textfield' id = 'spodYield' value = '<?php echo $spod; ?>'/></td>
                <td><h3>Crokite Yeild</h3></td>
                <td><input name = 'crokYeild' type = 'text' class = 'textfield' id = 'crokYeild' value = '<?php echo $crok; ?>'/></td>
              </tr>
              <tr>
                <td><h3>Bistot Yeild</h3></td>
                <td><input name = 'bisYeild' type = 'text' class = 'textfield' id = 'bisYeild' value = '<?php echo $bistot; ?>'/></td>
                <td><h3>Arkonor Yeild</h3></td>
                <td><input name = 'arkYeild' type = 'text' class = 'textfield' id = 'arkYeild' value = '<?php echo $ark; ?>'/></td>
                <td><h3>Mercoxit Yeild</h3></td>
                <td><input name = 'mercYeild' type = 'text' class = 'textfield' id = 'mercYeild' value = '<?php echo $merc; ?>'/></td>
              </tr>
            </table>
            <table align = 'center'>
              <tr>
                <td><input type = 'submit' value = 'Make Changes'></td>
              </tr>
            </table>
          </form>
        </div>
      </div>
    </body>
  </html>

CSS

  #sideContainer {float:left;}
#content {
  float:left;
  padding-left: 5px;
}
#content table {
  border-spacing:10;
  border-collapse:collapse;
}
#content h1 {
  vertical-align:top;
  height:40px; overflow:;
  color: #99CC00;
  margin: 0px 0px 5px;
  padding: 0px 0px 3px;
  font: bold 18px Verdana, Arial, Helvetica, sans-serif;
  border-bottom: 1px dashed #E6E8ED;
}
#content h2 {
  vertical-align:top;
  height:40px; overflow:;
  color: #336622;
  margin: 0px 0px 5px;
  padding: 0px 0px 3px;
  font: bold 24px Verdana, Arial, Helvetica, sans-serif;
  border-bottom: 1px dashed #E6E8ED;
}
#content h3 {
  text-align:bottom;
  height:30px; overflow:;
  color: #99CC00;
  margin: 0px 0px 5px;
  padding: 0px 0px 3px;
  font: bold 18px Verdana, Arial, Helvetica, sans-serif;
  border-bottom: 1px dashed #E6E8ED;
}
#content th {
  font-weight: bold;
  text-align: left;
}
#content a {
  color: #2D3954;
  font-size: 11px;
}
#content a:hover {
  color: #99CC00;
}
#userTable input{
  vertical-align:center;
  margin: 0px 0px 5px;
  padding: 0px 0px 3px;
  background: #ccffaa;
}
#vCode input{
  width: 10px;
}
#keyID input{
  width:100px;
}
#refining input{
  width:50px;
}


#sideTable {
  float:left;
  padding-left: 5px;
}



.err {
  color: #FF9900;
}

#navMain {
  margin-left:25px;
  color:#c3c3c3;
  font-family:Tahoma, Geneva, sans-serif;
}
#navMain h2{
  font-family:Trebuchet MS1, Helvetica, sans-serif;
} /*Change font of the title*/


#navMain ul{
  padding:0;
  margin:0;
  margin-left:25px;
  font-size:15;
  margin-right:20px;
} /*Reset the default padding/margin and set it as required*/


#navMain ul li a{
  font-size:15;
  text-decoration:none;
  color:#c3c3c3;
} /*Change color of link text and remove underline*/


#navMain ul li a:hover{
  color:#e0993e;
} /*Change color of hover text*

sidebar.html

<h2>Categories</h2>
<ul>
<li><a href="editUser-form.php">Edit Personal Info</a></li>
<li><a href="sellToCorp-form.php">Sell to Corp</a></li>
<li><a href="fleet-form.php">Fleet Log Parser</a></li>
<li><a href="theoreticalMining.php">Theoretical Mining</a></li>
<li><a href="theoreticalRefining.php">Theoretical Refining</a></li>
<li><a href="corpMail-form.php">Send Corp Mail - N/A</a></li>
<li><a href="setCorpRate-form.php">Set Corp Rate</a></li>
<li><a href="updateSkillList.php">Update Skills</a></li>
<li><a href="logout.php">logout</a></li>
</ul>
4

3 に答える 3

2

div を td タグ内に移動する必要があります。このようなもの :

<div id='content'>some content is here
  <div id='userTable'>
    <table>
  <tr>
    <th>table header</th>
  </tr>
  <tr>
    <td>
      <div id='chars64'>
        <input type='text' value='1234567812345678123456781234567812345678123456781234567812345678'>
      </div>
    </td>
  </tr>
  <tr>
    <td>
      <div id='chars7'>
        <input type='text' value='1234567'>
      </div>
    </td>
  </tr>
  <tr>
    <td>
      <div id='chars4'>
        <input type='text' value='0.123'>
      </div>
    </td>
  </tr>
</table>

ここにjsfiddleがあります:http://jsfiddle.net/TM5Mk/

これらの以前の議論も参照できます。

内の div 表のセル内に div を配置する

于 2013-01-13T11:08:38.773 に答える
1

有効な HTML テーブルがありません。

div要素内にtd要素を配置してから、入力のスタイルを設定する必要があります。要素の<div>前に追加することは無効です。tr

働くフィドル| | | 作業フィドルの更新

<div id = 'content'>
    some content is here
    <div id = 'userTable'>
        <table>
            <tr>
                <th>table header</th>
            </tr>
                <tr>
                    <td><div id = 'chars64'><input type = 'text' value = '1234567812345678123456781234567812345678123456781234567812345678'></div></td>
                    <td><div id = 'chars64'><input type = 'text' value = '1234567812345678123456781234567812345678123456781234567812345678'></div></td>
                    <td><div id = 'chars64'><input type = 'text' value = '1234567812345678123456781234567812345678123456781234567812345678'></div></td>
                    <td><div id = 'chars64'><input type = 'text' value = '1234567812345678123456781234567812345678123456781234567812345678'></div></td>
                </tr>
                <tr>
                    <td><div id = 'chars7'><input type = 'text' value = '1234567'</div</td>
                    <td><div id = 'chars7'><input type = 'text' value = '1234567'</div</td>
                    <td><div id = 'chars7'><input type = 'text' value = '1234567'</div</td>
                </tr>
                <tr>
                    <td><div id = 'chars4'><input type = 'text' value = '0.123'></div></td>
                    <td><div id = 'chars4'><input type = 'text' value = '0.123'></div></td>
                    <td><div id = 'chars4'><input type = 'text' value = '0.123'></div></td>
                </tr>
        </table>
    </div>
</div>
于 2013-01-13T11:01:27.167 に答える
1

それはあなたのHTMLが間違っているからだと思います。<table>に要素を入れることができます<div><div>入力を.. 全体ではなくラップするだけです<tr>。ここは:

<div id = "content">
    some content is here
    <div id = "userTable">
        <table>
            <tr>
                <th>table header</th>
            </tr>
                <tr>
                    <td> 
                        <div id = "chars64">
                            <input type = "text" value = "1234567812345678123456781234567812345678123456781234567812345678">
                        </div>
                    </td>  
                </tr>
                <tr>
                    <td> 
                        <div id = "chars7">
                            <input type = "text" value = "1234567">
                        </div>
                    </td>
                </tr>
                <tr>    
                    <td>
                        <div id = "chars4">
                            <input type = "text" value = "0.123"> 
                        </div>
                    </td>
                </tr>
        </table>
    </div>
</div>
于 2013-01-13T11:02:06.377 に答える