I'm trying to make some custom table with HTML and SASS. I searched many questions on this site, but none of them works for my case.
the properties of the table are:
I've already done with:
table-layout: fixed
: It works partially. But the column widths are divided equally across the table, regardless of content inside the cells. I need a responsive column. (If you activate the line 10 of SASS in my demo below, you can see what I said.)
overflow-x: scroll, auto, ...
: I succeeded to make scroll bar in the code block. But the width of the table exceeds the 'width: 100%'. In other words, the width of (which has the code block) stretches unlimitedly. (This is demonstrated in my the demo below.)
here is my demo: http://jsfiddle.net/purhvf0b/23/
add the below sass to td
td
border: 1px solid #444444
width: 1px
also add the below sass to third column (I have added a class longtd
to third td)
.longtd
overflow: auto
max-width: 0;
width: auto;
forked fiddle http://jsfiddle.net/Soothran/n57m0f1b/
try this
css
.width-100-border {
width: 100%;
border: 1px solid #00FF00;
overflow-x: auto;
}
table td{
border: 1px solid #444444;
max-width: 600px;
}
您可以使用m-custom-scrollbar jQuery插件http://manos.malihu.gr/jquery-custom-content-scroller/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.