我有一個問題...我有一些很長的超鏈接是純文本,我需要包裝...我找了小時,並沒有找到一種成功的方法它在Firefox和Internet Explorer上。它在Firefox上工作正常,沒有問題,但在IE上它延伸了表格。在IE和Firefox中包裝長文本
我真的可以用一些幫助來解決這個問題。
這裏是我的CSS,儘管它表示換行無效,我也試過table-layout:fixed
。
.wordwrap
{
display:inline-block;
word-wrap:break-word;
overflow:hidden;
}
,這裏是在aspx.cs的代碼文件
tr = new TableRow();
tc = new TableCell();
tc.ColumnSpan = 4;
tc.CssClass = "title";
tc.Text = "Comments";
tr.Cells.Add(tc);
table.Rows.Add(tr);
for (int i = 0; i < dv.Count; i++)
{
tr = new TableRow();
tc = new TableCell();
tc.ColumnSpan = 4;
tc.Wrap = true;
tc.CssClass = "wordwrap";
if (Request.QueryString["edit"] == null)
tc.Text = dv[i]["fulldescription"].ToString();
else
{
tc.Text = "<a href=\"editComment.aspx?id=" + dv[i]["id"].ToString() + "&oid=" + Request.QueryString["id"]
+ "&aid=" + dr["id"].ToString() + "&edit=1\">" + dv[i]["fulldescription"].ToString() + "</a>";
}
tr.Cells.Add(tc);
table.Rows.Add(tr);
}
如果你有什麼事,讓我知道...真是我所關心的是,如果部分工作現在。這是客戶看到的部分。
編輯: 編輯生成的html
<tr>
<td colspan="4" class="title">Comments</td>
</tr><tr>
<td colspan="4">These are some words that are displayed for this comment http://www.themostaweseomesthyperlinkeverbecauseitneverends.com/index.htm.</td>
</tr><tr>
<td colspan="4">These are some words that are displayed for this commnet with more http://www.uab.edu/......./.</td>
</tr><tr>
<td colspan="4">These are some words that are displayed for this commnet with more and maybe more http://www.themostaweseomesthyperlinkeverbecauseitneverendsdaskldklkdaskdkjldkljalkjsdkljdslkjdskljkljdsakljdskjldsakljlkjdsakljsdakljsdalkjdskljsdalkjlkjdsalkjsdaklsdalksdalksdlkjdslkjsldkjslkjdajalkasdkljlkjdsalkjdsalkjdsalkjadslkjlkjsdalkjdsalkjdsalkjdsalkjlkdsalkjdsalkjdaslkjsadklakdsakldsjdslakdjjldksdjdklslskdjdakldlkdajkdljkdajkdjkdjalkkdjlkajdlkjadjdajdajkdakjdaadljdakjadjdkjkadlkjdaljkdalkjadklkldajlkjdalkjdalkjdalkjdalkjdalkjdkajlkdadaklkdalkjdalkjdlkjdalkjdakldkajldkjalkjdaldkjalkjdalkjdalkjdakljdalkjdalkjljkadlkjdalkjdalkjlkdjalkjdadjalkldjalkjadadkjlkljdadjlkdlakjkljdakaljdlkjdalkjdakjladljkadkaldjlkjdakljadkjldalkkljdadakdakljkladjl.com/index.htm</td>
</tr><tr>
<td colspan="4">Theehese are some words that are displayed for this commnet with more and maybe morhese are some words that are displayed for this commnet with more and maybe morhese are some words that are displayed for this commnet with more and maybe morhese are some words that are displayed for this commnet with more and maybe more and more</a></td>
</tr>
對不起...... A標籤甚至不應該在那裏..只是重新編輯它..在客戶的報告中沒有超鏈接..我不小心從我看到的那個複製它..他們看不到..所有的東西都是一樣的。 。除了他們不能做超鏈接 – 2012-02-23 22:44:54
你覺得設置tc.Text =「
它可能,但是在塊級元素上應用'word-wrap'時,我得到的結果要少得多。如果它不適用於DIV,則可以嘗試在''標籤上使用它,因爲它是通用內聯元素。 – justbeez 2012-02-23 22:52:40