|
Re: Can't Format Table
Hello,
I am sorry, you asked me for a response in a private message, but I am still to new to the forum to send a private message back. I will try to help you here instead. Please remember that I am also just a beginner
When I said 'clear margins' I meant getting rid of unwanted space. Different browsers have different defaults and so on. So often when you are working in css you do something like:
someElement{
margin:0;
padding:0;
border:0;
other_stuff:etc;
}
In your case the css file has already set all the margins to 0 (if you look near the top it says:
*{
margin:0;
padding:0;
}
I wouldn't do that but don't change it now or your site will be a mess.
Here I what I suggest you do:
1. Color the background so you can see what you are doing. If you have to work with live changes, use a sort of neutral color that doesn't look to bad. If you work with a file on your hard drive, then make it red or yellow, so you really know exactly where you are working:
#sidebar table{
background-color:#ffffaa;
}
Now you can see it and you know what you are working with.
2. Now, if you want to keep it in a table, you can change the width from a fixed width to 100%. This fills that whole space which is confined by the sidebar div tag. Now it fills the space. You can do text-align to center it, or you can add padding or right align. When you have it right, don't forget to just delete the background-color tag, which is just there to show you where your table is.
#sidebars table {
border:0;
background-color:red;
width: 100%;
text-align:center;
}
If you want more specific control, rather than set the background-color for the whole thing, rather do this:
#sidebar table td {
background-color:purple;
}
and then you can work with aligning each part of it.
3. You could get rid of the table and use various things such as a list with floats to get it right, but if you don't know css that well, it's probably easier just to stick with the table for now. It can get very messy.
Cheers
|