表td会扩展吗?我把它固定在总桌宽的20%。我应该怎么做呢?
请在下面找到我的代码。问题是第3个td。
<style type="text/css">
.Method_SubTable_TD
{
border:solid black 1.0pt;
padding:0cm 5.4pt 0cm 5.4pt;
}
</style>
<br>
<br>
<table width="90%" >
<tr valign="bottom">
<td class= "Method_SubTable_TD" width="20%">
<p class="MsoNormal"><span style="color:black">Failure in Clicking on link ABC under Main tab</span></p>
</td>
<td style="background:#ffc7ce;" class= "Method_SubTable_TD" width="10%">
<p class="MsoNormal"><span style="color:#9c0006">FAILED</span></p>
</td>
<td class= "Method_SubTable_TD" width="20%">
<p class="MsoNormal"><span style="color:blue"><a><span style="color:blue;text-decoration:none; word-wrap:break-
word">file:/C:/Testing/<wbr>Selenium_Workspace/JSP/<wbr>Project/Results/<wbr>Scr eenshots/FailTC_2016-07-12_<wbr>12-04-38.jpeg</span></a></span></p>
</td>
<td class= "Method_SubTable_TD" width="10%">
<p class="MsoNormal"><span style="color:black">Test_DestinationsLink</span></p>
</td>
<td class= "Method_SubTable_TD" width="10%">
<p class="MsoNormal"><span style="color:black">88</span></p>
</td>
<td class= "Method_SubTable_TD" width="10%">
<p class="MsoNormal"><span style="color:black">Google Chrome</span></p>
</td>
<td class= "Method_SubTable_TD" width="20%">
<p class="show-read-more"><span style="color:black" ></span></p>
</td>
</tr>
</table>
答案 0 :(得分:0)
Yo可以将宽度样式设置为td
将 wrap 属性添加到td
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td width="70%" wrap>ABC</td>
<td width="30%" wrap>24</td>
</tr>
<tr>
<td>PQR</td>
<td>25</td>
</tr>
</table>
答案 1 :(得分:0)
谢谢大家。
之前我已将包装文本应用于span,但它不起作用。现在我将其更改为p标签及其工作原理。
请查看以下代码
p.test {
width: 11em;
word-wrap: break-word;
}
<td class= "Method_SubTable_TD" width="20%">
<p class="test"><span style="color:blue"><a><span style="color:blue;text-decoration:none; word-wrap:break-word;">
file:/C:/Testing/<wbr>Selenium_Workspace/JSP/<wbr>Project/Results/<wbr>Screenshots/FailTC_2016-07-12_<wbr>12-04-38.jpeg</span></a></span></p>
</td>