iT邦幫忙

0

請問我要怎麼把table的邊邊消掉

各位好,想請教我要怎麼把邊邊的灰框消除?
我看網路上用border-collapse:collapse;但還是無法.....
以下是我的程式碼:

	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
	<link  href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/all.css" rel="stylesheet">
	<link  href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.2/jquery.fancybox.css" rel="stylesheet">
	<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.2/jquery.fancybox.js"></script>
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css">
	 
	<div class="container" >
	  
	 <br><br>
			 
				<table class='table table-bordered text-center max ' style="border-collapse:collapse; ">
					<tr class='' bgcolor='#999961'  style="border-spacing:0; collapse;border:1px solid white;">
					<th class='text-center align-middle' style="border-radius:10% 0% 0% 0%;"> 客戶</th>
					  
					 <th class='text-center align-middle' >數量</th>
					 
					<th class='text-center align-middle' style="border-radius:0% 10% 0% 0%; "> 聯絡人<br>電話</th>
				  
					</tr> 
		  
				</tbody>
				</table>
			 
				</form>
				 
		 
	</div>

謝謝大家

看到這邊 table table-bordered text-center max
有上 bootstrap 吧,不要邊框就把 table-bordered 拿掉啊
不然去 bootstrap 官網看一下,關於table 有那些class 可用,給他用上去就好
不用想得太複雜
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

1
japhenchen
iT邦超人 1 級 ‧ 2021-08-26 10:32:27
最佳解答
table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}


/* 左上角 border-radius */

table tr:first-child th:first-child {
    border-top-left-radius: 10px;
}


/* 右上角 border-radius */

table tr:first-child th:last-child {
    border-top-right-radius: 10px;
}


/* 左下角 border-radius */

table tr:last-child td:first-child {
    border-bottom-left-radius: 10px;
}


/* 右下角 border-radius */

table tr:last-child td:last-child {
    border-bottom-right-radius: 10px;
}

https://ithelp.ithome.com.tw/upload/images/20210826/20117954YEEx91CLEo.jpg

看更多先前的回應...收起先前的回應...
amyqaz iT邦新手 4 級 ‧ 2021-08-26 10:55:25 檢舉

大大好:這方法是可行的,可是只要我加上這行就會破功,他的灰色的邊邊又會出現....

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">

把你自定的style css加在bootstrap.min.css的下方~

這是我的網頁用的

<link href="/scripts/bootstrap-5.0.0-beta3-dist/css/bootstrap.min.css" rel="stylesheet">
<script src="/scripts/jquery-3.6.0.min.js"></script>
<script src="/scripts/main.js"></script>
<link href="/scripts/common.css" rel="stylesheet">

或是你把圓角table用自定的class取代table tag

archer9080 iT邦研究生 4 級 ‧ 2021-08-26 11:17:54 檢舉

看起來應該是table-bordered這個class
拿掉自己重新刻左右邊
都用bootstrap了就別再用table排版了吧@@

th 跟 td 也要改,否則會破角

噗,不過有些狀況table會比row cell好搞定,就像我們這個有意見的主管,就是要看到有表格線的電子名片...反覆思索,也只有找到這個索路詢,掃名片上的QRCODE也只有用手機,所以一半table一半bootstrap...

amyqaz iT邦新手 4 級 ‧ 2021-08-26 11:27:51 檢舉

japhenchen好:
我本來就有把style加在bootstrap.min.css的下方了喔,可是還是會有此狀況

amyqaz iT邦新手 4 級 ‧ 2021-08-26 11:35:44 檢舉

OK,我解決了,謝謝大家

還是我是用5.0beta才沒出現這狀況?
https://ithelp.ithome.com.tw/upload/images/20210826/201179548q1JjnTWdx.jpg

我要發表回答

立即登入回答