小编Jos*_*ell的帖子

CSS到PDF,使用THEAD在新页面上重复标题

我有CSS和HTML,我将转换成PDF.我想在每个页面上指定一个标题,在PDF中,将在每个新页面上重复.

我知道我可以使用THEAD来指定标题,但是,是否有一个免费的html-to-pdf转换器会尊重THEAD标签?

如果没有,有没有其他选择?

谢谢...

html css pdf

6
推荐指数
2
解决办法
7074
查看次数

使用xslt样式表将xhtml空行转换为XSL-FO空行

我正在使用XSLT样式表(由Antennahouse)将XHTML转换为XSL-FO文件.我在我的XHTML文件中将一个空行定义为2个连续的HTML BR标记.现在,XSL-FO格式的空白行没有原生支持.我想通过在样式表为BR标记插入的fo:block中添加一个高度来解决这个限制.但是,我是XSLT语言的新手,我在这方面遇到了一些问题.

我可以弄清楚如何为我遇到的每个BR标签插入这个高度,但我只想在彼此之后有2个BR标签时插入空白行(否则在每个文本后面都会插入一个空行,然后是BR标签.)

我得到了一个"无意义"的表达式(11大于10),它将定义何时插入常规的fo:block或fo:block with space-after ="1em".显然这个表达没有任何意义,它应该检查的是这个BR元素是否是连续的第二个元素.如果有人能帮助我或指出我正确的方向,我将不胜感激.这就是我现在所拥有的:

<xsl:template match="html:br">
<xsl:choose>
    <xsl:when test="11 &gt; 10">
        <fo:block space-after="1em">
            <xsl:call-template name="process-common-attributes"/>
        </fo:block>
    </xsl:when>
    <xsl:otherwise>
        <fo:block>
            <xsl:call-template name="process-common-attributes"/>
        </fo:block>
    </xsl:otherwise>
  </xsl:choose>
Run Code Online (Sandbox Code Playgroud)

为了便于参考,这是一个XHTML,我希望将双BR标签转换为空行,但单个BR标签应该只是一个常规换行符.

                  <div style="color: #000000; font-family: arial; font-size: 10pt; font-style: normal; font-weight: normal;">
                    <span>description</span>
                    <br/>
                    <span>using</span>
                    <br/>
                    <span>multiple</span>
                    <br/>
                    <span>lines</span>
                    <br/>
                    <br/>
                    <span>with</span>
                    <br/>
                    <br/>
                    <span>blank</span>
                    <br/>
                    <br/>
                    <span>lines</span>
                    <br/>
                </div>
Run Code Online (Sandbox Code Playgroud)

html xslt insert

6
推荐指数
1
解决办法
1292
查看次数

我应该在哪里放置我的JavaScript代码?

我想使用自动完成代码.代码在这里.

<script>
    $(function() {
        var availableTags = [
            "ActionScript",
            "AppleScript",
            "Asp",
            "BASIC",
            "C",
            "C++",
            "Clojure",
            "COBOL",
            "ColdFusion",
            "Erlang",
            "Fortran",
            "Groovy",
            "Haskell",
            "Java",
            "JavaScript",
            "Lisp",
            "Perl",
            "PHP",
            "Python",
            "Ruby",
            "Scala",
            "Scheme"
        ];
        $( "#tags" ).autocomplete({
            source: availableTags
        });
    });
    </script>



<div class="demo">

<div class="ui-widget">
    <label for="tags">Tags: </label>
    <input id="tags">
</div>

</div><!-- End demo -->



<div class="demo-description" style="display: none; ">
<p>The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are tags for programming languages, give …
Run Code Online (Sandbox Code Playgroud)

javascript jquery autocomplete

6
推荐指数
2
解决办法
2万
查看次数

Is there a way to make absolutely positioned divs expand the container?

I have html template - div#container inside body, and some absolutely-positioned divs in container w/o fixed height. Is there a way to expand container to 100% height of page?

Here is an image demostrating my problem: http://habreffect.ru/files/4f3/54ad48420/q.png

I understand, that absolutely positioned divs are "invisible" for container, but unfortunately i got browser window expanded. The problem is, that i can't make body to fit 100% of page, and if I make height:100% of body (and html) it will fit 100% …

html css

6
推荐指数
1
解决办法
480
查看次数

当tbody css display属性为block时,如何对齐thead和tbody中的列

我和thead,tbody和tfoot有一张桌子.
显示的css值为block - 允许向主体添加滚动条并在thead和tfoot保持原位时滚动行.
由于表格宽度根据TD的宽度而变化,因此TD标签宽度不固定.
我想将thead的TH标签与tbody的TD标签对齐.

如何才能做到这一点?(CSS或JQuery)

编辑:
目标浏览器是谷歌 - Chrome!
并且添加了轻微的扭曲,表格是RTL.

CSS:

tbody{
    display: block;
    overflow: auto;
}

thead, tfoot{
    display: block;
}
Run Code Online (Sandbox Code Playgroud)

HTML:

    <table>
        <caption>My Table</caption>
        <thead>    
            <tr><th>Col1</th><th>Col2</th></tr>
        </thead>
        <tbody>    
            <tr><td>Cell11</td><td>Cell12</td></tr>
            <tr><td>Cell21</td><td>Cell22</td></tr>
            <tr><td>Cell31</td><td>Cell32</td></tr>
            <tr><td>Cell41</td><td>Cell42</td></tr>
            <tr><td>Cell51</td><td>Cell52</td></tr>
            <tr><td>Cell61 Is Wide</td><td>Cell62</td></tr>
        </tbody>
        <tfoot>
            <tr><th>6 Rows</th><th></th></tr>
        </tfoot>                
    </table>
Run Code Online (Sandbox Code Playgroud)

您可以使用此jsFiddle尝试它.

谢谢,快乐.

html css jquery

6
推荐指数
1
解决办法
8941
查看次数

CXF传出Interceptor得到的SOAP响应体总是为null?

我写了一个拦截器进行测试.但是我在Interceptor中得到的Soap消息体总是为空.

我的Cxf是Apache-CXF-2.4.0

bean.xml是这样的:

<cxf:bus>
    <cxf:outInterceptors>
        <ref bean="myOutSoapInterceptor"/>
  </cxf:outInterceptors>
</cxf:bus>
Run Code Online (Sandbox Code Playgroud)

拦截器文件:

public class MySoapInterceptorImpl extends AbstractSoapInterceptor implements IMySoapInterceptor {

public MySoapInterceptorImpl()
{
    super(Phase.WRITE );
    addAfter(SoapOutInterceptor.class.getName());
}


public void handleMessage(SoapMessage msg) throws Fault {
    // TODO Auto-generated method stub
    String soapContent ;
    SOAPMessage sm = msg.getContent(SOAPMessage.class);

    /*sm is always null!*/
    }
 }
Run Code Online (Sandbox Code Playgroud)

soap cxf response interceptor

6
推荐指数
2
解决办法
2万
查看次数

CSS使div 100%宽度与body相关,而不是它的父div

我有

<div style="position:relative; width:500px;">
    <div style="position:absolute; width:100%"></div>
</div>
Run Code Online (Sandbox Code Playgroud)

子div占用它的父div的100%宽度.有没有办法可以强制它采取100%宽度的身体而不是父div.我需要在上面的代码中进行相对和绝对定位.

html css width

6
推荐指数
1
解决办法
5716
查看次数

css:如何在选择文本时不突出显示<br>(在Chrome中)

我使用改变了文本高亮颜色::selection,这在我的页面中非常有用.但是,我发现Chrome的行为与FF不同,后者突出显示<br>默认的蓝色而不是我为所有元素设置的颜色.FF没有高亮, <br>所以它工作正常.

我试图覆盖::selectionfor <br>,不起作用; 试图使用user-select:none;,也不起作用; 试过display:none;,这简直让我的<br>一切都消失了......

任何的想法?

html css

6
推荐指数
1
解决办法
1465
查看次数

ASP.Net Web服务:异步运行代码

我有一个Web服务,可以分为两个主要部分:

[WebMethod]
MyServiceCall()
{
  //Do stuff the client cares about

  //Do stuff I care about
}
Run Code Online (Sandbox Code Playgroud)

我想要做的是在另一个线程上运行第二部分,以便客户端不等待它:一旦用户的逻辑完成,立即发送他们的信息,但继续处理我关心的东西(记录等).

从Web服务,以异步方式运行第二部分的推荐方法是什么,以便尽快让用户返回信息? BackgroundWorkerQueueUserWorkItem

asp.net .net-4.0

6
推荐指数
1
解决办法
612
查看次数

ASP.NET应用程序代码中的相对路径

不熟悉ASP.NET我不确定我的问题的最佳解决方案.我有一行代码如:

xDoc.Load("Templates/template1.cfg");
Run Code Online (Sandbox Code Playgroud)

xDoc是一个XmlDocument.在我的项目中,在顶层有一个名为Templates的目录.当我在调试模式下运行项目时,我得到了一个DirectoryNotFoundException,显然它正在寻找模板目录C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\Templates.

如何在没有硬编码的情况下正确指向该目录?

.net c# asp.net

6
推荐指数
2
解决办法
2万
查看次数

标签 统计

html ×6

css ×5

asp.net ×2

jquery ×2

.net ×1

.net-4.0 ×1

autocomplete ×1

c# ×1

cxf ×1

insert ×1

interceptor ×1

javascript ×1

pdf ×1

response ×1

soap ×1

width ×1

xslt ×1