熟女伦乱激情网一区二区,十八禁免费漫画在线观看,欲色欲香天天网综合久久,美女无遮挡隐私叼嗨网站

目前有很多智能的表格自適應(yīng)解決方案。

他們分別是 flip the table on it’s side, convert it to a pie chart, gradually reduce the columns, allow users to determine columns,設(shè)置允許 partial scrolling across the table.而這些都是智能的。

然而,我們也要注意到它們的缺點(diǎn):

  • 1.他們有一些在實(shí)際中是難以實(shí)現(xiàn)的,尤其是那些依靠::before偽元素來生成表頭的。

  • 2.他們之中有一些不適合所有類型中的表數(shù)據(jù),例如pie chart.

  • 3.他們之中有一些可能被用戶所拒絕。例如消失的列。

那么你想看到一個(gè)不需要javascript代碼,只需要幾行css就能解決自適應(yīng)表格的CSS嗎?請看下面的例子:

解決方案1:超級簡單

你需要做的就是用一個(gè)div來包含這個(gè)表格。

<div class="table-container">
<table>
...
<table>
</div>

然后添加下面的CSS代碼

.table-container
{
width: 100%;
overflow-y: auto;
_overflow: auto;
margin: 0 0 1em;
}

演示一

解決方案2:為IOS添加滾動(dòng)條

如果你在iOS下面(如iPhone)看這個(gè)案例的話,你會(huì)看不到滾動(dòng)條,雖然用戶可以滑動(dòng)表格滾動(dòng),但是這是不明顯的。我們只需要添加一些額外的CSS就能解決這個(gè)問題。

.table-container::-webkit-scrollbar
{
-webkit-appearance: none;
width: 14px;
height: 14px;
}

.table-container::-webkit-scrollbar-thumb
{
border-radius: 8px;
border: 3px solid #fff;
background-color: rgba(0, 0, 0, .3);
}

演示二

解決方案三:為每一個(gè)添加滾動(dòng)條

下面這些jquery插件可以幫到你

  • jScrollPane

  • Custom content scroller

  • jScroller

  • Tiny Scroller

解決方案四:添加一個(gè)漸變層

也許你已經(jīng)注意到了表格的邊緣被切割了,給它添加一個(gè)模糊的漸變層,為了適應(yīng)所有的設(shè)備,我們還需要添加一些標(biāo)記。

<div class="table-container-outer">
  	<div class="table-container-fade"></div>
  		<div class="table-container">
  		<table>  				...  			
		<table>  		
	</div>  	
</div>

下面是CSS

.table-container-outer { position: relative; }

.table-container-fade
{
	position: absolute;
	right: 0;
	width: 30px;
	height: 100%;
	background-image: -webkit-linear-gradient(0deg, rgba(255,255,255,.5), #fff);
	background-image: -moz-linear-gradient(0deg, rgba(255,255,255,.5), #fff);
	background-image: -ms-linear-gradient(0deg, rgba(255,255,255,.5), #fff);
	background-image: -o-linear-gradient(0deg, rgba(255,255,255,.5), #fff);
	background-image: linear-gradient(0deg, rgba(255,255,255,.5), #fff);
}

這就是你所看到的簡單的自適應(yīng)表格了。

穩(wěn)定

產(chǎn)品高可用性高并發(fā)

貼心

項(xiàng)目群及時(shí)溝通

專業(yè)

產(chǎn)品經(jīng)理1v1支持

快速

MVP模式小步快跑

承諾

我們選擇聲譽(yù)

堅(jiān)持

10年專注高端品質(zhì)開發(fā)
  • 返回頂部
罗田县| 密山市| 两当县| 安西县| 安塞县| 车险| 石台县| 松潘县| 河北区| 萍乡市| 郁南县| 金湖县| 泗水县| 肇庆市| 兴和县| 阿合奇县| 巴东县| 瓦房店市| 巴青县| 会昌县| 阿克陶县| 新乡市| 元阳县| 清丰县| 曲松县| 高台县| 如东县| 宣城市| 屏山县| 翁牛特旗| 永德县| 大关县| 通河县| 都安| 洪泽县| 密云县| 巧家县| 海南省| 彭州市| 明溪县| 西和县|