我正在尝试开发一个系统,使用户可以手动调整textarea和iframe的大小。我已经说明了我的意思:
<body>
<table width="100%">
<tr>
<!-- basically I want the user to be able to manually resize the width of the <td>'s -->
<td width="30%">
<textarea style="width:100%; height:100%;"></textarea>
</td>
<td width="70%">
<iframe style="width:100%; height:100%;" src=""></iframe>
</td>
</tr>
</table>
</body>
任何帮助都将受到高度赞赏, 谢谢:))
答案 0 :(得分:5)
试试这个:
public string UpdateData(string id,string value, int columnPosition)
{
ObjectId oid = new ObjectId(id);
var query = from n in ObjectMongoCollection.AsQueryable<User>()
where n.UserId == oid
select n;
User user = query.FirstOrDefault();
if (user == null)
{
return "error";
}
else
{
if (columnPosition == 0)
{
user.Name = value.Trim();
}
else if (columnPosition == 1)
{
user.Surname = value.Trim();
}
else
{
user.Number = value.Trim();
}
ObjectMongoCollection.Save(user);
return "successfull";
}
}
<强> Demo 强>
我只是想给你一个主意。
我所做的很简单,因为每个td你需要放置一个可调整大小的div,它具有该td的100%大小,然后将所有内容放入div中。每次调整div的大小时,td也会根据div的大小调整大小。
只需添加更多样式即可满足您的需求。