Html 溢出中未换行的文本:自动;宽度:在桌子内时为100%div
我最近遇到了一个奇怪的问题,表格单元格中有一个溢出的自动div(是的,我必须保留表格) div中的文本在表中时不会换行。如果我把这个div放在另一个div中进行包装,它工作得非常完美 我的临时解决方案是使用javascript强制调整宽度,但这很糟糕,而且无法很好地处理重新调整大小的问题 如果有人有任何想法,我很乐意听到 请参见此处的代码:Html 溢出中未换行的文本:自动;宽度:在桌子内时为100%div,html,css,Html,Css,我最近遇到了一个奇怪的问题,表格单元格中有一个溢出的自动div(是的,我必须保留表格) div中的文本在表中时不会换行。如果我把这个div放在另一个div中进行包装,它工作得非常完美 我的临时解决方案是使用javascript强制调整宽度,但这很糟糕,而且无法很好地处理重新调整大小的问题 如果有人有任何想法,我很乐意听到 请参见此处的代码: ip\84.23.214.125:27960\name\Ze\u Pequeno\password\bs\racered\1\raceblue\0\ra
ip\84.23.214.125:27960\name\Ze\u Pequeno\password\bs\racered\1\raceblue\0\rate\25000\ut\u timenudge\30\cg\rgb\153,0,0\funred\tridente\funblue\katana\cg\u predictitems\0\cg\gear\FHAOWRA\snaps\20\model\sarge\sarge\headmodel\sarge\team\model\james\team\team\headmodel\james\james\coll\color1\4\color2\5\disability\100\sex\mel\mean\team\guid\guid\table\cfu匿名任务5E18C17EAC67AF5A6F4247\weapmodes\00000111220000020000
ip\84.23.214.125:27960\name\Ze\u Pequeno\password\bs\racered\1\raceblue\0\rate\25000\ut\u timenudge\30\cg\u rgb\153,0,0\funred\tridente\funblue\katana\cg\u predictitems\0\cg\u physics\1\gear\FHAOWRA\snaps\20\model\sarge\headmodel\sarge\sarge\team\model\james\james\team\team\headmodel\james\james\coll\coll\coll\coll1\4\color2\5\e\cl\u匿名\0\teamtask\0\cl\u guid\49B4985AFD5E18C17EAC67AF5A6F4247\weapmodes\00000111220000020000
将单词break:break all
规则添加到表中(或表中的div)。因为实际上只有一个长字符串(没有空格),所以浏览器不会打断它,除非您强制它
将
单词break:break all
规则添加到表中(或表中的div)。因为实际上只有一个长字符串(没有空格),所以浏览器不会打断它,除非您强制它
除非我误解了你的意思,否则这应该可以:
<table style="width: 400px;" border="1">
<tr><td>
<div style="width: 100%; overflow: auto; height: 200px; border: 1px solid blue;">
ip\84.23.214.125:27960\name\Ze_Pequeno\password\bs\racered\1\raceblue\0\rate\25000\ut_timenudge\30\cg_rgb\153,0,0\funred\tridente\funblue\katana\cg_predictitems\0\cg_physics\1\gear\FHAOWRA\snaps\20\model\sarge\headmodel\sarge\team_model\james\team_headmodel\*james\color1\4\color2\5\handicap\100\sex\male\cl_anonymous\0\teamtask\0\cl_guid\49B4985AFD5E18C17EAC67AF5A6F4247\weapmodes\00000111220000020000
</div>
</td></tr></table>
ip\84.23.214.125:27960\name\Ze\u Pequeno\password\bs\racered\1\raceblue\0\rate\25000\ut\u timenudge\30\cg\rgb\153,0,0\funred\tridente\funblue\katana\cg\u predictitems\0\cg\gear\FHAOWRA\snaps\20\model\sarge\sarge\headmodel\sarge\team\model\james\team\team\headmodel\james\james\coll\color1\4\color2\5\disability\100\sex\mel\mean\team\guid\guid\table\cfu匿名任务5E18C17EAC67AF5A6F4247\weapmodes\00000111220000020000
小提琴:
ip\84.23.214.125:27960\name\Ze\u Pequeno\password\bs\racered\1\raceblue\0\rate\25000\ut\u timenudge\30\cg\u rgb\153,0,0\funred\tridente\funblue\katana\cg\u predictitems\0\cg\u physics\1\gear\FHAOWRA\snaps\20\model\sarge\headmodel\sarge\sarge\team\model\james\james\team\team\headmodel\james\james\coll\coll\coll\coll1\4\color2\5\e\cl\u匿名\0\teamtask\0\cl\u guid\49B4985AFD5E18C17EAC67AF5A6F4247\weapmodes\00000111220000020000
除非我误解了你,否则应该这样做:
<table style="width: 400px;" border="1">
<tr><td>
<div style="width: 100%; overflow: auto; height: 200px; border: 1px solid blue;">
ip\84.23.214.125:27960\name\Ze_Pequeno\password\bs\racered\1\raceblue\0\rate\25000\ut_timenudge\30\cg_rgb\153,0,0\funred\tridente\funblue\katana\cg_predictitems\0\cg_physics\1\gear\FHAOWRA\snaps\20\model\sarge\headmodel\sarge\team_model\james\team_headmodel\*james\color1\4\color2\5\handicap\100\sex\male\cl_anonymous\0\teamtask\0\cl_guid\49B4985AFD5E18C17EAC67AF5A6F4247\weapmodes\00000111220000020000
</div>
</td></tr></table>
ip\84.23.214.125:27960\name\Ze\u Pequeno\password\bs\racered\1\raceblue\0\rate\25000\ut\u timenudge\30\cg\rgb\153,0,0\funred\tridente\funblue\katana\cg\u predictitems\0\cg\gear\FHAOWRA\snaps\20\model\sarge\sarge\headmodel\sarge\team\model\james\team\team\headmodel\james\james\coll\color1\4\color2\5\disability\100\sex\mel\mean\team\guid\guid\table\cfu匿名任务5E18C17EAC67AF5A6F4247\weapmodes\00000111220000020000
小提琴:
ip\84.23.214.125:27960\name\Ze\u Pequeno\password\bs\racered\1\raceblue\0\rate\25000\ut\u timenudge\30\cg\u rgb\153,0,0\funred\tridente\funblue\katana\cg\u predictitems\0\cg\u physics\1\gear\FHAOWRA\snaps\20\model\sarge\headmodel\sarge\sarge\team\model\james\james\team\team\headmodel\james\james\coll\coll\coll\coll1\4\color2\5\e\cl\u匿名\0\teamtask\0\cl\u guid\49B4985AFD5E18C17EAC67AF5A6F4247\weapmodes\00000111220000020000
这就是最终对我起作用的原因-但是-我觉得正确的答案是“表布局:固定”;一个原因是这不会包装文本,但会迫使文本在div内溢出,而不会溢出表外。这是最终对我起作用的原因-但是-我觉得正确的答案是“表布局:固定”一个原因是,这不会包装文本,但会强制文本在div内溢出,不会溢出表外。这是正确的答案,但是,对于我的情况,它不起作用,因为我无法调整表属性(在问题中没有说明)。我会接受这个答案。谢谢。这是正确的答案,但是,对于我的情况,它不起作用,因为我无法调整表属性(在问题中没有说明)。我会接受这个答案。谢谢
<div style="width: 400px; border:1px solid pink">
<div style="width: 100%; overflow: auto; height: 200px; border: 1px solid blue">
ip\84.23.214.125:27960\name\Ze_Pequeno\password\bs\racered\1\raceblue\0\rate\25000\ut_timenudge\30\cg_rgb\153,0,0\funred\tridente\funblue\katana\cg_predictitems\0\cg_physics\1\gear\FHAOWRA\snaps\20\model\sarge\headmodel\sarge\team_model\james\team_headmodel\*james\color1\4\color2\5\handicap\100\sex\mal e\cl_anonymous\0\teamtask\0\cl_guid\49B4985AFD5E18C17EAC67AF5A6F4247\weapmodes\00000111220000020000
</div>
</div>