Imnotapotato
Imnotapotato

Reputation: 5798

How to remove padding from a table cell?

I have a table with two columns. The left side us usually 1 word, and the second one with a bit more text. When I have too much text on the second column, the first one expands and center the text.

How do I remove this unwanted padding so the text will be on the top-left? enter image description here

Upvotes: 3

Views: 2251

Answers (4)

Kawinesh S K
Kawinesh S K

Reputation: 3220

Just Select your Class via .tlt and add vertical-align:top you don't need to do anything more since for your .tlt just padding-right has been added so that there will be a space between two columns.

CSS

.tlt{
 vertical-align:top;
}

Add it at the end of your Css Code.

Upvotes: 0

Seer
Seer

Reputation: 739

Inside a table-row, the two cells have always the same height. It shows as a padding, but it's automatically applied.

As some users mentioned, you can set a vertical-align: top; for the cell, and than play with padding top to position the text.

Upvotes: 1

Majid Sadr
Majid Sadr

Reputation: 1071

in ALL browsers, the browser will make padding and margin between all the things. to remove that and control the page yourself add this add the first line of your css:

* {margin:0 auto; padding:0}

auto makes all the things (except text and images) at the center of your page.

and for your table if you want texts to be on top of your td, add this:

.tlt{vartical-align:top; text-align:left;}

Upvotes: 0

aashi
aashi

Reputation: 492

add css in td or in .tlt vertical-align:top

Upvotes: 2

Related Questions