开发者

JSF myfaces dataTable , how to avoid NBSP; tags in the TDs

I have style applied to the TD elements of the dataTable of my myfaces application.

td.financialReportTd {
    font-family: Arial;
    font-size: 12px;
    line-height: 12px;
    color:black;
    background-color: white;
        padding-right: 5px;
    text-align: right;
    border:0px black solid;
    height: 30px;
    padding-top:4px;
    padding-left:4px;
    vertical-align: top;
    direction: rtl;
}

Output:

<td class="financialReportTd">
    &nbsp;&nbsp;&nbsp;&nbsp;         
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;          

    &nbsp;&nbsp;&nbsp;&nbsp;MY TEXT
</td>

No matter what I try, those NBSP tags fill up the TD and position of the text ch开发者_开发技巧anges to the worse.

I tried style text-align:right; (I need RTL text), I tried direction: rtl; Nothing helps.

How can I align my text to the very right of the TD and avoid those space tags?


Are you 100% sure that the nbsps are not in the database (or whatever data source you are using)? They could have gotten there by an accident (or by conversion from excel or somewhere else); that would be more probable than such an error in JSF.


<h:column>
  ></h:panelGrid>
</h:column>

to eliminate NBSP, we need wrap the outputText into the panelGrid, plus (very important!) there should be NO sp happy :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜