How to change the colour of border in a table in html ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

How to change the colour of border in a table in html ?

I want to change the colour of the border of a table but i don't know how to do it. So if anyone knows then please tell me.

8th Jun 2019, 9:26 AM
Ashish
Ashish - avatar
5 Answers
+ 5
You have to use CSS: table { border: solid 1px green; /*1px green border*/ } (You can use inline styling too)
8th Jun 2019, 9:41 AM
Airree
Airree - avatar
+ 39
<table border="2" bordercolor="red"> <table border="2" bordercolor="black"> <table border="2" bordercolor="blue"> So on....
28th Jun 2019, 8:10 AM
Ananya
+ 5
Thanks
8th Jun 2019, 9:42 AM
Ashish
Ashish - avatar
+ 2
If you have to just do the border its easy firstly you have to do basic thing these terms table { } then put properties in it eg:- if you want border related type in that box border and there are lot of options already available like bordercolor select it and specify your color table { border-color:red; } just try to put these words options are already available in it of code playground Or second method you can apply directly in html file is attribute :- <table border="2" bordercolor="red" > <tr> <td>1<td> <td>2<td> </tr> </table>
25th Jun 2019, 12:21 PM
Sayyam Jain
Sayyam Jain - avatar
- 1
Use CSS
23rd Jun 2019, 6:34 PM
Sohail
Sohail - avatar