How to add padding and margin to the < th >

How to add padding and margin to the < th > cell

What issues were you having…?
http://codepen.io/ryanreese09/pen/EjKmvd

You can’t add margin to a td or th but you can add border-spacing to the table which will space the cells out.

table{border-spacing:10px; border-collapse: separate;}
1 Like

In this html document i want to increase top and bottom margin of those blue headings.
please help me.table.html (2.4 KB)

if your table is a solid color, you could do this:
take out the inline styling if you can.
give your table a class, e.g.: ‘badTable’

 		  .badTable td[colspan='2'] {border-bottom:10px solid #fff; color:#3B33DE;  font-weight:bold; background-color: #040E91; 	text-align:center;font-size:22px;font-family:monospace; color:#FFFFFF;}
		.badTable tr +tr td[colspan='2'] {border-top:10px solid;}

Technically speaking tho, your data isn’t ONE table but multiple tables, <TD colspan='2'> should be a header and not a TD
hope that helps

1 Like

Sounds like you just need this unless I am mistaken.

table{border-spacing:0 10px}

Of course the table should have a class applied rather than changing all tables.

1 Like

Yes. I applied the class later.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.