- This topic is empty.
-
AuthorPosts
-
July 11, 2014 at 2:23 am #175190KingslayerParticipant
Hello,
i have a new Project in which i have to use tables.
Now i was wondering how i can add space before or after a certain table row.
Example:
<table>
<tr>
<td> </td>
<td> </td>
</tr>
<tr class=”.gray”>
<td></td>
<td></td>
</tr>
<table>.gray just adds the background-color:#f1f1f1;
Now i want 10px of space after every tr that has the class .gray
margin or padding won’t work and i dont want to set display:block;
is their a quick workarround to add spacing.
Kind regards and thanks in advance
Fabi
July 11, 2014 at 2:29 am #175191Paulie_DMemberNow i want 10px of space after every tr that has the class
gray
.Space where? left, right, top, bottom?
Since this is a table row it’s not clear to me what you are trying to do.
A proper Codepen.io example would be useful.
July 11, 2014 at 2:46 am #175194KingslayerParticipanthttp://codepen.io/Paulie-D/pen/dFjwx
The space i want is after every gray row. So bottom i guess.
i could use a </br> i guess but that wouldn’t be the right solution.
Hope this makes it a little more clear
Edit: The Codepen is not showing for me it says /anon/CKnLb
MOD EDIT – Forked Pen and added
July 11, 2014 at 2:57 am #175195Paulie_DMemberYour table structure looked a little odd (you had extra
tr
in there for some reason).You have to add the padding to the
td
..if I understand correctly.July 11, 2014 at 3:02 am #175196KingslayerParticipantWhat is if i have this case
http://codepen.io/anon/pen/uxdEb
if i use your version i have spacing where i dont want it. That is why i wanted to add it after a whole row.
July 11, 2014 at 3:51 am #175199Paulie_DMemberI’m still not clear on what you want…
Rather than make yet another Codepen..perhaps an image would be of more use.
July 11, 2014 at 4:25 am #175203KingslayerParticipantI want to add extra space like 10 pixels above every row that contains a number. I have a class on those to check if they are filled vaild. So i wanted to add margin or padding top to a <tr> but this does not work. (had to clean the screenshot.)
Edit: maybe it helps to actually add the screenshot -.-
https://dl.dropboxusercontent.com/u/7209323/example.pngJuly 11, 2014 at 5:00 am #175214Paulie_DMemberHmmm…I’m pretty sure that this is not going to be a CSS solution. I cannot think of any selector that would do what you are after.
It might be possible with a whole bunch of selectors and/or
:not
statements but it would be quite difficult to think of every possible combination.This would have to be JS/JQ solution I feel.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.