ASP.NET - Calendar control - Strike off dates with a custom strike - asp.net

I want to strike off all the dates before today in a calendar control with an overlapping, red color x in ASP.NET. I can strikethru using the normal font strikethrough using the DayRender event. I can add an image but that sits adjacent to the date. I want the x (image) to overlap the date
Is this possible? If so, please help me how to go about it.
Thank you.

Use CSS,
Make the table cell position
relative
Make the image position
absolute, top & left: 0
Update:
The calendar control, like all ASP.NET control, outputs HTML. In this case it will output an HTML table, with a structure that looks something like this:
<table class="calendar_widget">
<tr>
<td>01</td>
<td>02</td>
<td>03</td>
<td>04</td>
<td>05</td>
<td>06</td>
<td>07</td>
</tr>
....etc
The <td>, or table-cell as it's known, will contain the date and image you're inserting. You can use CSS to apply specific styles to the cell and image so that they are rendered differently.
My guess is your calendar's HTML with an image will look something like this:
<td><img src="x.gif" />01</td>
You can use a CSS stylesheet to apply the following styles:
table.calendar_widget td {
position: relative;
}
table.calendar_widget td img {
position: absolute;
left: 0;
top: 0;
}
That's the basics of HTML - if this doesn't help I'd recommend tracking someone down familiar with front end development and getting their help.

Related

"top" style of table element not moving table down to lower position

I read this thread: Element not moving from top but I'm not sure it relates to what I'm doing. I have a test page that echoes out report data using PHP from a MYSQL database and the table's tag line of code is:
<table border='1'>
what I'd like to have is the table to position itself 27 pixels down from the top of the page so it is not in the background underneath the button I've got at the top. the button's code is:
<input type="button" onclick="emptyReport();" id="Button1" name="button" value="Clear Report"
style="position:absolute;left:1px;top:1px;width:96px;height:25px;font-family:Arial;font-size:13px;z-index:5">
what css property do I need to use to do this? I'm surprised I couldn't find anything on google considering this issue is overly simple. thanks.
It is hard to answer this question since you haven't provided the full HTML.
What I would suggest is to add the following Css to table:
table {
position: absolute;
top: 27px;
}
But this will be a shot in the dark without some more context.
Why would you position the table absolute anyway?
Making it relative with a padding-top: 27px would be more logic in my opinion.

is there a possible css trick for this

I'm using a podsnack mp3 player. However, every page refresh, refreshes random numerical div ID codes such as id="cover#some-random-number#
So it'll show up like this
covercontainer80191
covercontainer36190
And so forth. What I wanted to do is a display:none to hide the cover side and just display the song titles instead. Is there a way to do this in the CSS?
The code I'm using is actually an <iframe/>.
<iframe style="border:none;margin-bottom: 5px" src="http://files.podsnack.com/iframe/embed.html?hash=ah3fblli&t=1369709402" width="425" height="320" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" ></iframe>
If it's in an iframe I don't think there's much you can do with only CSS. It's a separate document and won't inherit styles from the parent document.
However, in your case you can do a little trick to accomplish your goals. Wrap the iframe in another element with overflow:hidden, then position the iframe in a way that hides the unwanted content:
<div>
<iframe></iframe>
</div>
You'll have to tweak the numbers here, but this seemed good for your case:
div {
overflow:hidden;
width:199px;
height:260px;
position:relative;
}
iframe {
position:absolute;
top:-43px;
left:-200px
}
Demo, with just the playlist displayed: http://jsfiddle.net/sxyXF/
However, the "cover side" also contains the play button, so there's no way to play the tracks.
If i'm understanding your question you want to hide all of these instances...if that's the case you can do this in your CSS to hide them
div[class~="covercontainer"]{
display:none;
}

<hr> between 2 rows in GridView

I have a nice working grid view but I want to have a <hr> tag between every row.
My GridView has 2 columns, so it will be rendered as:
<table>
<tr><td>x</td><td>y>/td></tr>
<tr><td>x</td><td>y>/td></tr>
</table>
I want to have:
<table>
<tr><td>x</td><td>y</td></tr>
<tr><td colspan="2"><hr></td></tr>
<tr><td>x</td><td>y</td></tr>
</table>
try to use AlternatingRowStyle intelligently to acheive this. IMHO there no straightforward way of doing it.
If i understand your question, you are expecting a line for each TR.
Why dont you try with CSS
tr { border-bottom:2px solid #eee;}
or
tr td { border-bottom:2px solid #eee;} /* border for all tds and not tr */
The GridView does a lot, but when you want finer-grained control over the layout, a Repeater can offer more.
The linked page includes an example showing how you can create the entire HTML table within the Repeater, starting with the header template, continuing in item templates, and ending in the footer template. It doesn't take much to set up and can be very powerful.

Can I place an html img tag behind an html table that contains background images?

As the title implies, is it possible to place an img tag behind a table that contains background images?
Here is an example and also the page source
The table contains background images
just add position: relative; to your table and you will get the desired result
AS:
<table width="100%" border="1" style="position: relative;z-index:2; margin-top:-170px;">
....
</table>
NOTE: Using Inline CSS is not a good idea try external Stylesheet

How to deal with my sharepoint datetime control css?

I'm developing sharepoint datetime control and got some problem with css of this control.
below is my html code.
<td style="padding-top: -10px">
<SharePoint:DateTimeControl CalendarImageUrl="/_layouts/NCS.OCP.Resource/images/calendar.jpg"
DatePickerFrameUrl="/_layouts/iframe.aspx" ID="DateDOB" DateOnly="true" Calendar="Gregorian"
LocaleId="2057" runat="server"></SharePoint:DateTimeControl>
<td>
I have tried modify ms-input css with padding-top -10px but failed, this control always falls down of my td.
is there any way to pull this control up so that this td can on one line...?
Looks like sharepoint has it's own <div>s or <td>s. Maybe even some custom css/
Try inspecting the elements, getting their ID's and then changing it with JS.

Resources