代码如下:
<div style=" width:200pxheight:100pxfloat:right">
<table></table>
<table></table>
</div>
为了省时表格里的tr,td没写,只用table代替了
HTML设置单元格的对齐方式,首先是有2种方式的,通过给这个table设置对齐,还有就是通过给单元格来单独设置,居中的属性是align,参数有left,center,right,垂直方向的valign,有top,middle,bottom,给table设置的就是在直接去algin:center,单元格就是td后面来个valign:bottom,具体看下代码:
<html>
<head>
</head>
<body>
<table
align='center'>
<tr>
<td
valign='bottom'>我是测试文字</td>
</tr>
</table>
</body>
</html>
html语言中对齐有两种,水平对齐和垂直对齐,水平对齐为align,一共有left center right三个值,垂直对齐为valign,分别有top middle bottom三个值。既然是所有的都上对齐建议你在table的style里面加上valign:top。如果table的属性里没有垂直对齐那你可以在每个tr的属性里设置欢迎分享,转载请注明来源:内存溢出
评论列表(0条)