2016-06-29 4 views
-1

ここに学生ID、学生名、質問1などのような列があります。width of column "question"を増やしたいと思います。これどうやってするの?テーブルの特定の列の幅を広げたい

テーブルヘッダtag like width="100"にオブジェクトを追加することで幅を追加しようとしましたが、単純なhtmlコードとして機能しますが、ここで必要なコードでは機能しません。 '

<?php 
        if (isset($result_display)) { 
         echo "<p><u>Result</u></p>"; 
         if ($result_display == 'No record found !') { 
          echo $result_display; 
         } else { 
          echo "<table class='result_table'>"; 
          echo '<tr><th>Student ID</th><th>Student Name</th><th>Question#1</th><th>Answer#1</th><th>Question#2</th><th>Answer#2</th><th>Question#3</th><th>Answer#3</th><th>Question#4</th><th>Answer#4</th><th>Question#5</th><th>Answer#5</th><th>Question#6</th><th>Answer#6</th><th>Question#7</th><th>Answer#7</th><th>Question#8</th><th>Answer#8</th><th>Question#9</th><th>Answer#9</th><th>Question#10</th><th>Answer#10</th><th>Question#11</th><th>Answer#11</th><th>Question#12</th><th>Answer#12</th><th>Question#13</th><th>Answer#13</th><th>Question#14</th><th>Answer#14</th><th>Question#15</th><th>Answer#15</th><tr/>'; 
          foreach ($result_display as $value) { 
           echo '<tr>' . '<td class="e_id">' . $value->id . '</td>' .'<td class="name">' . $value->Student_name . '</td>' . '<td>' . $value->question1 . '</td>' . '<td class="j_date">' . $value->Answer1 . '</td>' . '<td>' . $value->question2 . '</td>' . '<td class="mob">' . $value->Answer2 . '</td>' . '<td >' . $value->question3 . '</td>' . '<td>' . $value->Answer3 . '</td>' . '<td>' . $value->question4 . '</td>' . '<td>' . $value->Answer4 . '</td>' . '<td>' . $value->question5 . '</td>' . '<td>' . $value->Answer5 . '</td>' . '<td>' . $value->question6 . '</td>' . '<td>' . $value->Answer6 . '</td>' . '<td>' . $value->question7 . '</td>' . '<td>' . $value->Answer7 . '</td>' . '<td>' . $value->question8 . '</td>' . '<td>' . $value->Answer8 . '</td>' . '<td>' . $value->question9 . '</td>' . '<td>' . $value->Answer9 . '</td>' . '<td>' . $value->question10 . '</td>' . '<td>' . $value->Answer10 . '</td>' . '<td>' . $value->question11 . '</td>' . '<td>' . $value->Answer11 . '</td>' . '<td>' . $value->question12 . '</td>' . '<td>' . $value->Answer12 . '</td>' . '<td>' . $value->question13 . '</td>' . '<td>' . $value->Answer13 . '</td>' . '<td>' . $value->question14 . '</td>' . '<td>' . $value->Answer14 . '</td>' . '<td>' . $value->question15 . '</td>' . '<td>' . $value->Answer15 . '</td>' . '<tr/>'; 
          } 
          echo '</table>'; 
         } 
        } 
        ?> 

       </div> 
      </div> 
+0

ようこそ!すべてのコードが適切にフォーマットされるように質問を編集してください(可能な場合)。また、そのコードを試してみてください。 –

答えて

0

thタグにスタイル属性を使用します。

​​

これはジョブを実行する必要があります。そうでない場合は、%を使用することもできます。

<th style="width: 30%;">Question#1</th> 
関連する問題