Width of control

  • Thread starter Thread starter Thomas Scheiderich
  • Start date Start date
T

Thomas Scheiderich

I have a calander control that is inside a large cell. I have the width set
up to "Width='100%'". What I would like it to do is be 50 pixels less that
the 100% so that it would always be a blank area on either side of the cell.
Something like Width=100%-50 (I know this is not valid - just to illustrate
what I am trying to do.

I don't want to use cellpadding or cellspacing as there is other data in the
cell that I don't want to to work this way.

Thanks,

Tom.
 
You might try applying a style to the control with a margin of 50px on the
side you want the extra pixels.
 
Rocky Moore said:
You might try applying a style to the control with a margin of 50px on the
side you want the extra pixels.

How do I do that, assuming my asp:calender is "myCalendar?

Thanks,

Tom.
 
Thomas Scheiderich said:
How do I do that, assuming my asp:calender is "myCalendar?

Thanks,

Tom.

Normally, I would say just define it in a CSS style as your can set that on
the web controls, but after a bit of looking it appears that the calendar
control not only applies that style to the frame table that it generates but
also to the header (where it says month and year), which can really mess
things up.

For this control it would be best to embed the control in either a div or a
single cell table that you have control over. Of course, by the standards
you are not supposed to use a div in a table, but that is one rule I think
it is stupid and should be changed, so for me, I ignore it :)

So, if you want to use a single cell table, you can specify a width of 100%
and a margin-right (if it was the right side you wanted) of the size you
want to buffer it by. I use this often when I have a block of text to be
centered with a margin when the rest of the cell will needs full width.
 
Rocky Moore said:
Normally, I would say just define it in a CSS style as your can set that on
the web controls, but after a bit of looking it appears that the calendar
control not only applies that style to the frame table that it generates but
also to the header (where it says month and year), which can really mess
things up.

For this control it would be best to embed the control in either a div or a
single cell table that you have control over. Of course, by the standards
you are not supposed to use a div in a table, but that is one rule I think
it is stupid and should be changed, so for me, I ignore it :)

So, if you want to use a single cell table, you can specify a width of 100%
and a margin-right (if it was the right side you wanted) of the size you
want to buffer it by. I use this often when I have a block of text to be
centered with a margin when the rest of the cell will needs full width.

in my case I am already in a <td> section (<td><asp:calendar ... /> </td>.

How would I set up the table the way you are talking about? Something like:

<td>
<table >
<tr>
<asp:calendar ... />
</tr>
</table>
</td>

But where do I do the margin-right? Doesn't that have to be in a CSS page?

Thanks,

Tom.
 
Thomas Scheiderich said:
in my case I am already in a <td> section (<td><asp:calendar ... /> </td>.

How would I set up the table the way you are talking about? Something like:

<td>
<table >
<tr>
<asp:calendar ... />
</tr>
</table>
</td>

But where do I do the margin-right? Doesn't that have to be in a CSS page?

Thanks,

Tom.

Close.. It would be:

<table border=0 width=100%>
<tr><td style="padding-right:20px">
<asp:calendar .../>
</td></tr></table>
 
Posted this earlier but did not appear the group. Sorry if it comes in as a
duplicate somewhere.
----
Thomas Scheiderich said:
in my case I am already in a <td> section (<td><asp:calendar ... /> </td>.

How would I set up the table the way you are talking about? Something like:

<td>
<table >
<tr>
<asp:calendar ... />
</tr>
</table>
</td>

But where do I do the margin-right? Doesn't that have to be in a CSS page?

Thanks,

Tom.

Close.. It would be:

<table border=0 width=100%>
<tr><td style="padding-right:20px">
<asp:calendar .../>
</td></tr></table>
 
Rocky Moore said:
Posted this earlier but did not appear the group. Sorry if it comes in as a
duplicate somewhere.
----


Close.. It would be:

<table border=0 width=100%>
<tr><td style="padding-right:20px">
<asp:calendar .../>
</td></tr></table>

I will look at that tonight or tomorrow.

Thanks,

Tom
 
Back
Top