Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/365.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 自动换行:中断word未按IE8中的预期工作_Javascript_Asp.net_Internet Explorer_Browser_Internet Explorer 8 - Fatal编程技术网

Javascript 自动换行:中断word未按IE8中的预期工作

Javascript 自动换行:中断word未按IE8中的预期工作,javascript,asp.net,internet-explorer,browser,internet-explorer-8,Javascript,Asp.net,Internet Explorer,Browser,Internet Explorer 8,我跟着 也就是说,要使用wordwrap:break-word,我们需要为table元素设置“table layout:fixed”。即便如此,它在IE8中也不起作用。我是不是缺少了一些基本的东西 Iam将其屏幕截图附加到IE8和IE6中。以及如何在IE8中呈现HTML。 (IE8中包含表格的面板有滚动条。) 从呈现的HTML中,我发现表布局是固定的,样式也是应用的 但即便如此,IE8也以不同的方式显示网格 <table cellspacing="0" rules="all" bor

我跟着

也就是说,要使用wordwrap:break-word,我们需要为table元素设置“table layout:fixed”。即便如此,它在IE8中也不起作用。我是不是缺少了一些基本的东西

Iam将其屏幕截图附加到IE8和IE6中。以及如何在IE8中呈现HTML。 (IE8中包含表格的面板有滚动条。)

从呈现的HTML中,我发现表布局是固定的,样式也是应用的

但即便如此,IE8也以不同的方式显示网格

<table cellspacing="0" rules="all" border="0" id="ctl00_memberContentPlaceHolder_empiMemberHcidGridView" style="border-width:0px;border-style:None;height:150px;width:750px;border-collapse:collapse;**table-layout: fixed**">
            <tr class="Row" align="center">
                <td align="left" style="width:155px;white-space:nowrap;">
                                        <span id="ctl00_memberContentPlaceHolder_empiMemberHcidGridView_ctl02_typeLabel">IT</span>
                                    </td><td align="left" style="width:155px;white-space:nowrap;">
                                        <span id="ctl00_memberContentPlaceHolder_empiMemberHcidGridView_ctl02_firstNameLabel">AAA</span>
                                    </td><td align="left" style="width:155px;white-space:nowrap;">
                                        <span id="ctl00_memberContentPlaceHolder_empiMemberHcidGridView_ctl02_lastNameLabel">BBB</span>
                                    </td><td align="left" style="width:155px;white-space:nowrap;">
                                        <span id="ctl00_memberContentPlaceHolder_empiMemberHcidGridView_ctl02_appReceivedDateLabel">3/01/2011</span>
                                    </td><td align="left" style="width:155px;white-space:nowrap;**WORD-BREAK:BREAK-ALL**">
                                        <span id="ctl00_memberContentPlaceHolder_empiMemberHcidGridView_ctl02_commentsLabel">TestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTesting</span>
                                    </td>
        </table>

信息技术
AAA
BBB
3/01/2011
测试测试测试测试测试测试测试测试测试

有什么帮助吗?提前感谢

实际上,我不会担心您的示例中看到的人为文本的换行(没有空格)


据说,解决方案之一是将内容包装在一个div中,并将width和word wrap应用到div中。例如,请参见此提琴:

@Vinay..Thank..I从开发者工具栏中看到,应用了样式“word wrap:break word”,而不是导致问题的原因?在u所说的链接中,style应用于div,style得到applied@Ananth,
span
是内联元素,因此您还需要将其设置为
block
inline block
,以便分词工作。请参阅更新的示例,我假设您使用的是ASP.NET标签,该标签正在生成跨度,因此对标签应用一些css类以启用工作中断。