2012-09-14 59 views
0

我有一个像这样用导航按钮一个GridView:如何让IE正确显示我的GridView寻呼机按钮行的边框?

<PagerSettings Mode="NextPreviousFirstLast" FirstPageText="<<" PreviousPageText="<" NextPageText=">" LastPageText=" >>" Position="Bottom" /> 

有了这样设置寻呼机风格:

<PagerStyle CssClass="gridPager" HorizontalAlign="Right" /> 

请看看我的风格:

.gridPager 
    { 
     border-collapse: collapse; 
     border-width: 1px; 
     border-color: Green; 
     border-style: solid; 
     font-size: 7pt; 
    } 

    .gridPager td 
    { 
     padding-left: 5px; 
    } 

的我的一排传呼机按钮上的绿色边框不显示在Internet Explorer中

我怀疑这是因为IE不识别tr元素上的边框样式。

我怀疑这是,当我按下F12,看着IE显影剂视图,我看到,在GridView生成的表格创建此该行含有分页按钮的原因:

<tr class="gridPager" align="right"> 
    <td colspan="3"><table border="0"> 
    <tr> 
    <td><a href="...pager button links" </td> 
    </tr> 
</table></td> 
    </tr> 

通知在TR风格...

而且我发现这一点: https://stackoverflow.com/a/583600/614263

我试图按照那个帖子的说明,但没有运气。 它确实但是,当我使边框宽度为2px或更大。这并不好,但我需要薄的1px边框,以便它与网格的其余部分相匹配。

我想要做的就是围绕我的寻呼机按钮与网格中其余行中存在的相同颜色的边框。

请帮忙!我怎样才能做到这一点?这是我的时间!谢谢!

+0

类似于'.gridPager> td {border-color:Green}'的def怎么样? –

+0

@安妮。非常感谢,但没有工作 – unnknown

回答

1

尝试不同的方法。相反造型的.gridPager(“TR”)的标签把你的风格在桌子上,而不是

.gridPager table { ...styles here...} 

你可能有消除表之前,首先“TD”填充/保证金的工作,但应该轻松完成。

.gridPager td { padding: 0; margin: 0; } /* this will affect all td tags */ 
.gridPager table td { padding-left: 5px; } /* add the padding back to the table td tags */ 

对我来说 ...我通常风格,除了周围的底部边框边缘的边框,整个表。然后我通过'td'标签添加单行行。我把表格放在GridLines =“none”中。

/* this line give the table a border on the three sides - the main grid view table */ 
.gridTable { border: solid 1px #000; border-width: 1px 1px 0 1px } 

/* then I put in the row styles */ 
.gridTable td { border-bottom: solid 1px #000; } 

/* Then I fix the pager styles up with no border on the 'td' tag */ 
.gridTable table td { border: 0; } 
+0

谢谢叶卡捷琳娜,我今天晚些时候会尝试 – unnknown

+0

这让我朝着正确的方向前进。非常感谢!我使用自定义样式代替网格线,就像您在答案底部提到的一样,但是我必须为GridView中的每个列设置ItemStyle,因为在其中一列上我不想要正确的边框。 – unnknown

+0

我很高兴你能看到你的想法。 – ZombieCode