html - How to justify css table cells? -
well have css table looks this
------------------------------------------------------------- | first | middle1 | middle2 | last | -------------------------------------------------------------
i'm looking design
------------------------------------------------------------- | first | middle1 | middle2 | last | -------------------------------------------------------------
first column aligned left, middle columns aligned center, , last column aligned right. i'm using solution targets :first-child , :last-child in order align them specifically. there better/smarter way?
use td align attribute:
td { min-width:100px; border:1px solid black; }
<table> <tr> <td align="left">left</td> <td align="center">center</td> <td align="center">center</td> <td align="right">right</td> </tr> </table>
Comments
Post a Comment