Project

General

Profile

百分比固定表格控制连续英文换行的方法!

技术文档
10/11/2012

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<style>
table{table-layout: fixed;}
td{word-break: break-all; word-wrap:break-word;}
</style>
<body>
大家都知道连续的英文或数字能是容器被撑大,不能根据容器的大小自动换行

2.在使用百分比固定td大小情况下使用样式table-layout:fixed

<table width="600" border="0" cellspacing="0" cellpadding="0" class="tb">
<tr>
<td width="20%" >Mitt Romney promises to exert American influence in the world and pledges to help Syrians "obtain the arms they need" to defeat the regime</td>
<td width="80%">sdfasdfasd</td>
</tr>
</table>

</body>
</html>

Files