Saturday, March 31, 2012

Table...StyleSheet...CellPadding = 0, I cant do it :(

Having a very bad day :(
Why does .NET default to CellPadding and CellSpacing of 2?!
How on earth can I set them to all be 0.
I tried adding a table style to the style sheet, but cellpadding and cellspacing do not come up in intelisense :(
Any ideas?
WokaWhy is that VS.NET's fault? :rolleyes:

For cellpadding:

padding: 0 0 0 0;

For cellspacing, it's best to leave it in the table tag, I haven't seen a 'universal' solution to cellspacing in CSS.
That's what I would have thought.
In my CSS file I have:

TABLE
{
border: solid 0px Red;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}

TR
{
border: solid 0px Blue;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}

TD
{
border: solid 0px Lime;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}

Yet, as you can see from the attached pic, the images do not sit next to each other.
I am forced to add cellpadding and cellspacing to the table directly in my ASPX page (code in front).

The border props are only there for testing. The tables and cells etc do take on all the properties from my style sheet, apart from the cellpaddingthing etc :(

WOka
You should be using floating div's for a menu control anway ;)

Anyway, those 'cells' could be easily duplicated with span tags with a style padding of 10px.

<span style="padding:5px;">Home</span><span style="padding:5px;">About Us</span><span style="padding:5px;">Products</span>

0 comments:

Post a Comment