2018-10-04 14:47:55 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								---
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								title: Styling Tables
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								---
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								## Styling Tables
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-16 01:25:12 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Tables can be styled with css properties, such as ```table-layout` ``,` ``border-collapse` ``,` ``border` ``,` ``width` ``,` ``height` ``,` ``text-align` ``,` ``font` ``,` ``color` ``etc.
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 14:47:55 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-16 01:25:12 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								### Example
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```css
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*set table border to solid black*/
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								table, th, td {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   border: 1px solid black;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								table {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    border-collapse: collapse;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*set padding of 15px to all table elements and aligns to left*/
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								th, td {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    padding: 15px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    text-align: left;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 14:47:55 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								#### More Information:
  
						 
					
						
							
								
									
										
										
										
											2018-10-16 01:25:12 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 -   [MDN ](https://developer.mozilla.org/en-US/docs/Learn/CSS/Styling_boxes/Styling_tables )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 -   [w3schools ](https://www.w3schools.com/css/css_table.asp )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 14:47:55 +01:00