2011-08-04 42 views
0

我回來了.... ....好想要改變我的漂亮的評論框....的權力確實colspan工作在textarea ?.如果是的話......我的格式錯了嗎?COLSPAN在textarea中工作嗎?

正如你可以看到它看起來時髦....非常感謝幫助:)

enter image description here

<form id="commentForm" name="commentForm" action="" method="post"> 
<ctl:vertScroll height="300" headerStyleClass="data_table_scroll" bodyStyleClass="data_table_scroll" enabled="${user.scrollTables}"> 
<ctl:sortableTblHdrSetup topTotal="false" href="show.whatif_edit_entry?entryId=${entry.entryId}"/> 
<table class="data_table vert_scroll_table" style="width:360px;"> 
    <tr> 

    <ctl:sortableTblHdr styleClass="center" title="User" property="auditable.createdBy.lastName" type="top">User</ctl:sortableTblHdr> 
    <ctl:sortableTblHdr styleClass="center" title="Date" property="auditable.createdDate" type="top">Date</ctl:sortableTblHdr> 
    <ctl:sortableTblHdr styleClass="center" title="Comments" property="comment" type="top">Comments</ctl:sortableTblHdr> 
    </tr> 
    <c:forEach var="comments" items="${entry.comments}"> 
    <tr id="id${comments.id}"> 
     <c:choose> 
      <c:when test="${comments.auditable != null}"> 
     <td> 
      ${comments.auditable.createdBy.lastName}, ${comments.auditable.createdBy.firstName} 
     </td> 


      <td title="<fmt:formatDate value="${comments.auditable.createdDate}" pattern="${date_time_pattern}" />"><span class="mouseover_text"><fmt:formatDate value="${comments.auditable.createdDate}" pattern="${date_time_pattern}" /></span> 
      </td> 

      </c:when> 
     <c:otherwise> 
     <td colspan="1">&nbsp;</td> 
     <td colspan="1">&nbsp;</td> 
    </c:otherwise> 
    </c:choose> 
    <td id="comments-${comments.id}" style="width:400px;"><pre style="width: auto;">${comments.comment}</pre></td> 

    </c:forEach> 
    </tr> 


    <c:if test="${lock.locked || form.entryId < 0 }"> 

    <%-- This is the row for adding a new comment. --%>   

     <tr id="commentRow">    
     <td> 
     You have <strong><span id="commentsCounter">${const['COMMENT_MAX_LENGTH'] - fn:length(commentForm.comment)}</span></strong> characters left.<br/> 
      <textarea id="comment" colspan="3" name="comment" rows="2" cols="125" style="width:380px;" 
       onkeypress="characterCounter('commentsCounter',${const['COMMENT_MAX_LENGTH']}, this)" 
       onkeydown="characterCounter('commentsCounter',${const['COMMENT_MAX_LENGTH']}, this)" 
       onkeyup="characterCounter('commentsCounter',${const['COMMENT_MAX_LENGTH']}, this)"></textarea> 

        <a href="javascript:addComment();"><img src="../images/icon_add.gif" border="0" alt="Add"/></a> 
     </td> 

     </tr> 

    </c:if> 
</table> 
</ctl:vertScroll> 

+0

飲料上我! –

回答

4

沒有,colspan屬性所屬的<td>元素包含 textarea。

+0

織補.......我有一種感覺....任何建議? –

+0

@ user748656:是:在包含textarea的'​​'元素上使用'colspan'。如果你在兩行之間閱讀,你甚至可以在bobince的答案中看到這個建議。 –

+0

謝謝先生! –

2

colspan屬性不屬於<textarea>。你肯定希望將它應用到其包含<td>代替:

<%-- This is the row for adding a new comment. --%>   

    <tr id="commentRow">    
    <td colspan="3"> 
    You have <strong><span id="commentsCounter">${const['COMMENT_MAX_LENGTH'] - fn:length(commentForm.comment)}</span></strong> characters left.<br/> 
     <textarea id="comment" name="comment" rows="2" cols="125" style="width:380px;" 
      onkeypress="characterCounter('commentsCounter',${const['COMMENT_MAX_LENGTH']}, this)" 
      onkeydown="characterCounter('commentsCounter',${const['COMMENT_MAX_LENGTH']}, this)" 
      onkeyup="characterCounter('commentsCounter',${const['COMMENT_MAX_LENGTH']}, this)"></textarea> 

       <a href="javascript:addComment();"><img src="../images/icon_add.gif" border="0" alt="Add"/></a> 
    </td> 

    </tr> 
+0

謝謝你的合作伙伴....伏特加對我的射擊! –

1

沒有,合併單元格僅適用於表。如果你想跨越列,你應該使用<td>而不是textarea上的colspan。

+0

謝謝先生....知道了 –

1

編號colspan代表<td><th>元素,用於指出它們應該跨越多少列的表格。對於不是表格單元的元素沒有任何意義。

你想:

<tr id="commentRow">    
    <td colspan="3"> 
    You have <strong><span id="commentsCounter">${const['COMMENT_MAX_LENGTH'] - fn:length(commentForm.comment)}</span></strong> characters left.<br/> 
     <textarea id="comment"... 
+0

謝謝先生......我的一個html noob –