所以我正在学习一些php,发现我的html技能有点生疏了.我正试图让我的textarea跨越两个表列.W3schools说我可以为<th>标签做一个colspan 但是没有看到它是否被支持<td>.我想把它分成两个表格相同的表格.似乎有一种更简单的方法可以做到这一点.我确实尝试过td colspan"2",但它没有做任何事情
echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" id="crud_form">';
echo '<table id="table_articles">';
echo '<tr><td>Article Title:</td><td> <input type="text" name="art_title" /></td></tr>';
echo '<tr><td>Author:</td><td> <input type="text" name="author" /></td></tr>';
echo '<tr><td>Date Posted:</td><td> <input type="text" name="d_posted" /></td></tr>';
echo '<tr><td>Article Text:</td></tr>';
echo '<tr><td><textarea rows="10" columns="60" name="art_text" ></textarea></td></tr>';
echo '<tr><td><input type="submit" name="submit_art" value="Submit" /></td></tr>';
echo '</table>';
echo '</form>';
Run Code Online (Sandbox Code Playgroud)
CSS
#crud_form
{
color:red;
position:absolute;
left:300px;
top:200px;
border-style:outset;
border-width:5px;
border-color:red;
background-color:#cccccc;
}
#table_articles
{
color:red;
width:450px;
height:300px;
}
Run Code Online (Sandbox Code Playgroud)
思考?谢谢您的帮助.
<td colspan="2">...</td> 绝对正确.
<table border="1">
<tr>
<td>Column 1</td>
<td>Column 2</td>
</tr>
<tr>
<td colspan="2"><textarea style="width: 100%;" /></td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)