COLSPAN在textarea工作吗?

时间:2011-08-04 18:47:41

标签: html css

我回来了...... ....想要改变我的好评论框的权力.... 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>

4 个答案:

答案 0 :(得分:4)

不,colspan属性属于包含 textarea的<td>元素。

答案 1 :(得分: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>

答案 2 :(得分:1)

不,colspan仅适用于表格。如果要跨列,则应使用<td>上的colspan而不是textarea。

答案 3 :(得分: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"...