开发者

How to align all elements in the tr to the left side of the table?

开发者 https://www.devze.com 2023-03-08 08:55 出处:网络
I have a table with couple inputs and button on the last row. I want to align them all to the left side. Is it possible to apply float:left to all tr ? also I want it work for IE :)

I have a table with couple inputs and button on the last row. I want to align them all to the left side. Is it possible to apply float:left to all tr ? also I want it work for IE :)

I have:

<tab开发者_C百科le>
<tbody>
  <tr>
   <th> </th>
   <td> </td>
  </tr>
</tbody>
</table>


Does this not work?

<tr>
    <td style="text-align:left">html here</td>
</tr>

That should align all elements to the left. If the table looks funny, make sure you don't need to use colspan.


Apply text-align to your desired cells..

To do all cells do this:

td, th {text-align:left}


Yes you can apply it to the entire row. text-align:left would do the trick I think.

<table>
<tbody>
  <tr style="float:left">
   <th> </th>
   <td> </td>
  </tr>
</tbody>
</table>
0

精彩评论

暂无评论...
验证码 换一张
取 消