2017-09-06 15 views
0

The code that is being rendered Shows the table rendered, as you can see, once I scroll past the max width the data wont show材料UI表都有一个毁了我的CSS额外div标签

<div> 
 
    <table (not gonna show all the markup for this. this table holds the headers of each column. this appears when i scroll to the right past the max width)> 
 
</div> 
 
<div styel="height: inherit; overflow-x:hidden; overflow-y: auto;"> 
 
    <table (not gonna show all the markup. this holds the rows of data, that dont appear past the max width)> 
 
    </div>

当从图像1中的代码获取呈现,存在过去的最大宽度确实数据当我滚动到右侧时不会显示。

然而,表格标题确实如此。经过调查,我发现问题是div标签。

它的标记,当我检查网页(HTML代码段以上)的方式,table的头被包裹在一个div标签,以及tablebody被包裹在另一个div标签。

身体周围的div标签有风格overflow-:x hiddenoverflow-y: auto(绕头的div标签有没有风格)。

如果我没有设置这两个溢出,表格看起来完全是我想要的样子。

但是,我没有编码这些div标签,我不知道他们是如何到达那里的,我猜材料UI把它们放在那里。我如何更改或摆脱这些标签?还是有解决办法?

回答

0

您可以通过withStyles(styles)(YourTable)传递样式/主题,如this example。 或者,您可以将className添加到您的TableBody并相应地更新您的CSS。