我想中心动态表的内容。我正在使用从jquery库中选择的元素。我希望桌子上的所有文字都在中心位置。我尝试了所有常用的方法,但我无法在中心找到文本。 我的代码是:居中我的动态表的内容css php
<tbody id="tbody_chosen">
<?php foreach($table as $row){
$num = $row->total_quantity - $row->available_quantity;
echo "<tr>
<td>{$row->id}</td>
<td>{$row->name}</td>
<td>{$row->total_quantity}</td>
<td>{$num}</td>
<td>{$row->available_quantity}</td>
<td>{$row->inOrder}</td>";
if(have_access("manager"))
//TODO here we have to use the product's supplier ID
echo "<td>
<input type=\"checkbox\" name=\"selector[]\" value=\"{$row->id}\" id=\"selector-{$row->id}\"/>
<input type=\"hidden\" name=\"selector_id[]\" id=\"selector_id-{$row->id}\" value=\"{$row->supplied_by}\" />
</td>";
echo "</tr>";
} ?>
</tbody>
在你的css文件中:'tr {text-align:center;}' – Melki 2013-04-23 08:41:28