Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want my textarea to expand over four HtmlTable columns, but it restricts itself to the first of these columns only.

Seemingly the same code works for a label (it expands across the four cols, centering itself in them).

I wish I could paste a scream shot here, but will instead try to, in 1,000 words, describe it:

The Comment label/text appears centered within the four columns
The textarea appears only in the first 1/4th of the cell.


So here's the code for Comments, which looks as I want it to:

HTML
<td colspan="4" class="nobordercell centertext"><label>Comments</label></td>


...and here is the code for the textarea, which doesn't look as I want it to:

HTML
<td colspan="4"><input colspan="4" type="textarea" 
name="airfareComments" id="airfareComments" title="to/from" class="lightsteelblue"/></td>


I tried it with "colspan="4"" on the td, on the textarea and, as shown above, in both; it doesn't matter - none of it works.

What do I need to change?
Posted

1 solution

You have made many-many mistakes.
- input has no colspan property.
- there is no textarea input type
- you haven't used styling

XML
<style>
td {border: 1px solid red; width: 100px; height:50px;text-align:center;}
</style>
<table>
<tr>
<td>1</td><td>2</td><td>3</td><td>4</td><td>5</td>
</tr>
<tr>
<td colspan="4"><input type="text" style="width:100%"></td><td>5</td>
</tr>
<tr>
<td colspan="4"><textarea style="width:100%"></textarea></td><td>5</td>
</tr>
</table>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900