简体   繁体   English

无法覆盖现有的CSS

[英]Unable to override existing CSS

I am using the example mentioned here in my project. 我在我的项目中使用此处提到的示例。 I want to stretch the table to fit the whole page. 我想拉伸桌子以适合整个页面。

So, I did: 所以我做了:

html, body{
    height: 100%;
}

#gridContainer {
    height: 100%;
}

table{
    width: 100%;
    height: 100%;
}

The problem is, only the table header appears on the page and it is stretched properly. 问题是,仅表标题出现在页面上,并且已正确拉伸。 The rows do not show up. 这些行不显示。 I also tried to place the <script> before the <style> , but no luck. 我还尝试将<script>放在<style>之前,但是没有运气。

How do I fix this? 我该如何解决?

Make the below change. 进行以下更改。

table, div {
   width: 100% !important;
}
.dojoxGridxBody, .gridContainer, table, #gridContainer {
    width: 100% !important;
}

If you want to make no other changes you will have to use !important to override some of the original CSS. 如果您不希望进行其他任何更改,则必须使用!important覆盖某些原始CSS。 But you can use the chrome inspector to find out what this style is overriding, remove the widths that would be set without this in the old CSS and then remove the !important 但是,您可以使用chrome inspector找出此样式的替代内容,删除在旧CSS中没有此设置的宽度,然后删除!important

This page is far from ideally laid out however, as when you change the column structure the page just gets wider and wider. 但是,此页面的布局并不理想,因为当您更改列结构时,页面会变得越来越宽。 You have multiple tables and divs within these when actually you only need one table. 当您实际上只需要一个表时,其中就有多个表和div。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM