https://codepen.io/anon/pen/VbyzER
<div> <!-- Div has set height, overflow hidden-->
<table>
<!-- Tons of rows -->
</table>
</div>
忽略内联CSS的混乱。无论我做什么,桌子似乎都会溢出它的包装div。
答案 0 :(得分:0)
你有
#wrapper {
height: 300px;
overflow-x: hidden;
overflow-y: auto;
}
代替overflow-x: hidden
或除overflow-y: hidden
之外,您应该使用<!DOCTYPE html>
<html>
<head>
<style>
div {
border:solid 1px red;
height:128px;
overflow-y:hidden;
}
</style>
</head>
<body>
<div>
<table>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
<tr><td>X</td></tr>
</table>
</div>
</body>
</html>
。
如果它不适合你,那你就做错了。
Imgproc.cvtColor(image, image, Imgproc.COLOR_BGR2GRAY, 0);
originalFrameGrayScale = image.clone();
Mat morph = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(9, 3));
Imgproc.morphologyEx(image, image, Imgproc.MORPH_TOPHAT, morph);
Imgproc.Sobel(image, image, -1, 2, 0);
Imgproc.GaussianBlur(image, image, new Size(5,5), 3,3);
Imgproc.morphologyEx(image, image, Imgproc.MORPH_CLOSE, morph);
Imgproc.threshold(image, image, 200, 255, Imgproc.THRESH_OTSU);
Vector<Rect> rectangles = detectionContour(image);
&#13;