我试图在ID列上加入两个列表(flist和slist).列表定义,类定义,列表内容和所需结果如下所示.
List<first> flist= new List<first>();
List<second> slist= new List<second>();
public class first
{
public string name { get; set; }
public int ID{ get; set; }
public string itemAttr { get; set; }
}
public class second
{
public int ID{ get; set; }
public string itemAttr{ get; set; }
}
Run Code Online (Sandbox Code Playgroud)
列出内容
flist:
apples | 1
bananas| 2
trees | 3
slist:
1 | fruit
3 | not-fruit
Run Code Online (Sandbox Code Playgroud)
期望的结果:
flist:
apples | 1 | fruit
bananas | 2 |
trees …Run Code Online (Sandbox Code Playgroud) 在两列表中(其中两列都设置为valign top并且文本设置为text-align:baseline),如果第二列的第一行中存在图像且图像高度高于文本本身,两列中的文本未对齐.
我想在第二列的第一行中存在图像时动态地向第一列添加填充顶部.如果调整窗口大小并且图像不再位于第一行(或者新图像被推入第一行),则第1列中文本的填充顶部应自动更新以确保基线文本在两列中排成一行.
<html>
<head>
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript" src="scripts/script.js"></script>
<link rel="stylesheet" type="text/css" href="styles/style.css" />
</head>
<body>
<table>
<tr>
<td style="vertical-align:top"><p class="tabhead">Note:</p></td>
<td style="vertical-align:top"><p class="tabtext">This is text and - z0mg no, not an image!<img src="http://files.softicons.com/download/web-icons/minicons-numbers-icons-by-icojam/png/16x16/blue/025.png" /> what will we do?<br />Save us!</p></td>
</tr>
</table>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
样式表
.tabhead
{
display: block;
vertical-align: top;
font-family: "Tahoma", verdana, arial, helvetica, sans-serif;
font-style: normal;
font-variant: normal;
font-weight: bold;
font-size: 9pt;
}
.tabtext
{
font-family: "Tahoma", verdana, arial, helvetica, sans-serif;
font-style: normal;
font-variant: …Run Code Online (Sandbox Code Playgroud)