goonerray71 Posted March 6, 2015 Share Posted March 6, 2015 Is it possible to create tab columns with varying widths, so that they are not all equal? For example, 6 columns: col 1 5% col 2 25% col 3 40% col 4 10% col 5 10% col 6 10% thanks Link to comment Share on other sites More sharing options...
davej Posted March 6, 2015 Share Posted March 6, 2015 What do you mean by "tab" ? <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"/><title>title</title><style>th{background-color:#ddd;}th,td{border:1px solid #bbb;padding:10px;text-align:center;}th:nth-child(1){background-color:red;width:30px;}th:nth-child(3){background-color:green;width:50px;}th:nth-child(5){background-color:yellow;width:70px;}th:nth-child(7){background-color:orange;width:90px;}td:nth-child(2){background-color:#ddd;}td:nth-child(4){background-color:#ddd;}td:nth-child(6){background-color:#ddd;}</style></head><body><table><tr><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th></tr><tr><td>a</td><td>b</td><td>c</td><td>d</td><td>e</td><td>f</td><td>g</td></tr><tr><td>a</td><td>b</td><td>c</td><td>d</td><td>e</td><td>f</td><td>g</td></tr><tr><td>a</td><td>b</td><td>c</td><td>d</td><td>e</td><td>f</td><td>g</td></tr></table></body></html> Link to comment Share on other sites More sharing options...
goonerray71 Posted March 6, 2015 Author Share Posted March 6, 2015 Thank you for this example, but I don't want table heads in bold; can I avoid this? Link to comment Share on other sites More sharing options...
davej Posted March 6, 2015 Share Posted March 6, 2015 Just use td rather than th or you could style th{font-weight:normal;} Link to comment Share on other sites More sharing options...
dsonesuk Posted March 6, 2015 Share Posted March 6, 2015 Thank you for this example, but I don't want table heads in bold; can I avoid this?You have already been given a answer to this questionhttp://w3schools.invisionzone.com/index.php?showtopic=52583#entry290078 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now