3
私のプロジェクトは、テキストではなく選択オプションで表のセルを表示する方法です。私はこのような私のページでオプションを選択するには、テーブルのセルを変換したい入力から、セルテーブル内で複数行を変換するオプションを選択する
Andy
Alex
John
etc...
ので:
<form method="post">
<textarea name="input"></textarea>
<button type="submit" name="button">button</button>
<table class="table table-bordered" id="tableAll">
<thead>
<tr>
<th class="col-md-1">name</th>
</tr>
</thead>
<tbody>
<tr>
<?php
if(isset($_POST['button']))
{
echo "<td>".$_POST["input"]."</td>";
}
?>
</tr>
</tbody>
</table>
</form>
<style>
td { white-space:pre }
</style>
私はこのようなテキストエリアで入力された:
は、私は単純なコードを持っています:
<table class="table table-bordered" id="tableAll">
<thead>
<tr>
<th class="col-md-1">name</th>
</tr>
</thead>
<tbody>
<tr>
<select>
<option>Andy</option>
<option>Alex</option>
<option>John</option>
<option>etc...</option>
</select>
</tr>
</tbody>
</table>