Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html outlook 2010冻结列标题_Html_Css_Email_Outlook - Fatal编程技术网

Html outlook 2010冻结列标题

Html outlook 2010冻结列标题,html,css,email,outlook,Html,Css,Email,Outlook,我正在从Sql Server生成HTML电子邮件,其中一些电子邮件将包含一个包含许多行的表。我想实现冻结的列标题,以便在滚动数据(在电子邮件中)时,列标题始终保持可见。我尝试过使用css的许多不同的解决方案,但都无济于事。我知道Outlook不会识别javascript,所以我一直坚持使用css来识别javascript,我可以在各种网站上识别javascript,但Outlook 2010的反应不同 我知道Outlook中的css引擎真的像是回到了2001年。有人能就如何实现这一目标提出建议吗

我正在从Sql Server生成HTML电子邮件,其中一些电子邮件将包含一个包含许多行的表。我想实现冻结的列标题,以便在滚动数据(在电子邮件中)时,列标题始终保持可见。我尝试过使用css的许多不同的解决方案,但都无济于事。我知道Outlook不会识别javascript,所以我一直坚持使用css来识别javascript,我可以在各种网站上识别javascript,但Outlook 2010的反应不同

我知道Outlook中的css引擎真的像是回到了2001年。有人能就如何实现这一目标提出建议吗。我只对Outlook功能感兴趣,因为它是我们唯一的电子邮件工具

我尝试过使用这段代码,它可以在JSFIDLE中使用,但不能在电子邮件中使用:

<style type="text/css">
table, td {
text-align:center;
}

th {
font-weight:bold;
text-align:center;
}


table th {
padding:10px 10px 10px 10px;
border-top:0;
border-bottom:1px solid #e0e0e0;
border-left: 1px solid #e0e0e0;
background: #ededed;
}

table th:first-child {
text-align: left;
}

table tr:first-child th:first-child {
border-top-left-radius:3px;
border-left: 0;
}

table tr:first-child th:last-child {
border-top-right-radius:3px;
}

table tr {
text-align: center;
}

table td:first-child {
text-align: left;
border-left: 0;
}

table td {
padding:10px;
border-bottom:1px solid #e0e0e0;
border-left: 1px solid #e0e0e0;
background: #fafafa;
}

table tr:last-child td {
border-bottom:0;
}

table tr:last-child td:first-child {
border-bottom-left-radius:3px;
}

table tr:last-child td:last-child {
border-bottom-right-radius:3px;
}

table th, table td {
width: 160px;
}

#wrapper {
width: 740px;
height: 300px;
overflow-x: scroll;
overflow-y: scroll;
}

table thead {
position:fixed;
}

</style>

<body>

<div id="wrapper">
<table>

<!-- Table Header -->
<thead>
    <tr>
        <th>Task Details</th>
        <th>Firstname</th>
        <th>Lastname</th>
        <th>Progress</th>
        <th>Vital Task</th>
    </tr>
</thead>
<!-- Table Header -->



<!-- Table Body -->
<tbody>

    <tr>
        <td>Create pretty table design</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>100%</td>
        <td>Yes</td>
    </tr><!-- Table Row -->

    <tr>
        <td>Take the dog for a walk</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>100%</td>
        <td>Yes</td>
    </tr><!-- Darker Table Row -->

    <tr>
        <td>Waste half the day on Twitter</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>20%</td>
        <td>No</td>
    </tr>

    <tr>
        <td>Feel inferior after viewing Dribble</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>80%</td>
        <td>No</td>
    </tr>

    <tr>
        <td>Wince at &quot;to do&quot; list</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>100%</td>
        <td>Yes</td>
    </tr>

    <tr>
        <td>Vow to complete personal project</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>23%</td>
        <td>yes</td>
    </tr>

    <tr>
        <td>Procrastinate</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>80%</td>
        <td>No</td>
    </tr>

    <tr>
        <td><a href="#yep-iit-doesnt-exist">Hyperlink Example</a></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>80%</td>
        <td><a href="#inexistent-id">Another</a></td>
    </tr>

</tbody>
<!-- Table Body -->

</table>
</div>

</body>

表,td{
文本对齐:居中;
}
th{
字体大小:粗体;
文本对齐:居中;
}
表th{
填充:10px 10px 10px 10px;
边界顶部:0;
边框底部:1px实心#e0;
左边框:1px实心#e0;
背景:#ededed;
}
表th:第一个孩子{
文本对齐:左对齐;
}
表tr:第一个孩子th:第一个孩子{
边框左上半径:3px;
左边框:0;
}
表tr:第一个孩子th:最后一个孩子{
边框右上角半径:3px;
}
表tr{
文本对齐:居中;
}
表td:第一个孩子{
文本对齐:左对齐;
左边框:0;
}
表td{
填充:10px;
边框底部:1px实心#e0;
左边框:1px实心#e0;
背景:#fafafa;
}
表tr:最后一个孩子td{
边界底部:0;
}
表tr:最后一个孩子td:第一个孩子{
边框左下半径:3px;
}
表tr:last child td:last child{
边框右下半径:3px;
}
表th、表td{
宽度:160px;
}
#包装纸{
宽度:740px;
高度:300px;
溢出-x:滚动;
溢出y:滚动;
}
餐桌{
位置:固定;
}
任务详细信息
名字
姓氏
进展
要务
创建漂亮的桌面设计
100%
对
带狗去散步
100%
对
在推特上浪费半天时间
20%
不
看完运球后感到自卑
80%
不
在“待办事项”列表中退出
100%
对
发誓要完成个人项目
23%
对
拖延
80%
不
80%
非常感谢你的帮助,
Paul

不幸的是,Outlook不支持CSS位置或溢出,因此在CSS中执行此操作似乎是不可能的


因为你只针对Outlook,所以你可以试着搞乱它。这大部分是未知领域,所以不确定你是否能找到有效的方法。查看如何将VML应用于html电子邮件的示例。如果您尝试这种方法,请告诉我们它是如何运行的。

为什么不发送一个受保护的excel文档?我现在发送一个指向excel文件的链接,其中包含冻结的窗格。不幸的是,用户似乎不想打开链接。我需要将内容放在电子邮件正文中,这样对他们来说非常简单。好的,谢谢你,John,我以前使用VML编写经典asp代码,然后使用excel打开网站。如果我能做点什么,我一定会回信的。