Tampilkan postingan dengan label IT. Tampilkan semua postingan
Tampilkan postingan dengan label IT. Tampilkan semua postingan
Senin, 15 April 2019
Manipulasi Date SQL Server
CAST(CAST(year(golivedate) AS varchar) + '-' + CAST(month(golivedate) AS varchar) + '-' + CAST(1 AS varchar) AS DATETIME) as period
Rabu, 13 Februari 2019
Manipulasi tanggal di sql server
Manipulasi tanggal di sql server :
Sumber -> https://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/
Sumber -> https://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/
----Last Day of Previous Month
SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE()),0))
----Last Day of Current Month
SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+1,0))
----Last Day of Next MonthSELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+2,0))
SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE()),0))
----Last Day of Current Month
SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+1,0))
----Last Day of Next MonthSELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+2,0))
ResultSet:
LastDay_PreviousMonth
———————–
2007-07-31 23:59:59.000
LastDay_CurrentMonth
———————–
2007-08-31 23:59:59.000
LastDay_NextMonth
———————–
2007-09-30 23:59:59.000
----------------------------------------------------------------------------------------------------------------------
--Last Day of Any Month and YearDECLARE @dtDate DATETIMESET @dtDate = '8/18/2007'SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,@dtDate)+1,0))LastDay_AnyMonth
ResultSet:
LastDay_AnyMonth
———————–
2007-08-31 23:59:59.000
Minggu, 11 Desember 2016
CSS Background Image
body {
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: fixed;}
atau
body {
background: #ffffff url("img_tree.png") no-repeat right top;}
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: fixed;}
atau
body {
background: #ffffff url("img_tree.png") no-repeat right top;}
Sabtu, 10 Desember 2016
Form List HTML
Form List Biasa :
<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>
Form List by Group :
<select>
<optgroup label="Swedish Cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</optgroup>
</select>
<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>
Form List by Group :
<select>
<optgroup label="Swedish Cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</optgroup>
</select>
Grouping Form HTML
Contoh :
<form>
<fieldset>
<legend>Personalia:</legend>
Name: <input type="text" size="30"><br>
Email: <input type="text" size="30"><br>
Date of birth: <input type="text" size="10">
</fieldset>
</form>
<form>
<fieldset>
<legend>Personalia:</legend>
Name: <input type="text" size="30"><br>
Email: <input type="text" size="30"><br>
Date of birth: <input type="text" size="10">
</fieldset>
</form>
HTML5
HTML5 <datalist> Element
Input dari list yang di validasi :
<form action="action_page.php">
<input list="browsers">
<datalist id="browsers">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>
</form>
<input list="browsers">
<datalist id="browsers">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>
</form>
Menu Header Horizontal Lists
HTML lists can be styled in many different ways with CSS.
One popular way is to style a list horizontally, to create a menu:
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333333;}
li {
float: left;}
li a {
display: block;
color: white;
text-align: center;
padding: 16px;
text-decoration: none;}
li a:hover {
background-color: #111111;}</style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333333;}
li {
float: left;}
li a {
display: block;
color: white;
text-align: center;
padding: 16px;
text-decoration: none;}
li a:hover {
background-color: #111111;}</style>
</head>
<body>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>
Keterangan :
list-style-type: none; -> Menghilangkan bulatan dari listfloat: right; -> untuk ke kiri atau ke kanan
overflow -> kalau text kepanjangan maka disetting fixed atau ada scroll, agar lebih paham cek disini
display: block; -> Menampilkan text secara block, agar lebih paham cek disini
text-decoration: none; -> Menghilangkan garis bawah link
Lebar Table & Merger
Lebar Table :
<table style="width:100%"> atau <table style="width:20px">
Merge Table :
<th colspan="2">Telephone</th>
<th rowspan="2">Telephone:</th>
Single Line Border Table
HTML Table - Collapsed Borders
If you want the borders to collapse into one border, add the CSS border-collapse property:
table, th, td {
border: 1px solid black;
border-collapse: collapse;}
border: 1px solid black;
border-collapse: collapse;}
Judul Tabel (HTML Table - Adding a Caption)
HTML Table - Adding a Caption
To add a caption to a table, use the <caption> tag:
<table style="width:100%">
<caption>Monthly savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$50</td>
</tr>
</table>
<caption>Monthly savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$50</td>
</tr>
</table>
A Special Style for One Table
To define a special style for a special table, add an id attribute to the table:
Example
table id="t01">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>
Now you can define a special style for this table:
table#t01 {
width: 100%;
background-color: #f1f1c1;}
width: 100%;
background-color: #f1f1c1;}
And add more styles:
table#t01 tr:nth-child(even) {
background-color: #eee;}
table#t01 tr:nth-child(odd) {
background-color: #fff;}
table#t01 th {
color: white;
background-color: black;}
background-color: #eee;}
table#t01 tr:nth-child(odd) {
background-color: #fff;}
table#t01 th {
color: white;
background-color: black;}
Color Link HTML
a:link {color:green; background-color:transparent; text-decoration:none}
a:visited {color:pink; background-color:transparent; text-decoration:none}
a:hover {color:red; background-color:transparent; text-decoration:underline}
a:active {color:yellow; background-color:transparent; text-decoration:underline}
Site: http://www.w3schools.com/html/html_links.asp
Sabtu, 24 September 2016
Membuat avatar image lingkaran dengan css
http://stackoverflow.com/questions/21852978/bootstrap-3-using-img-circle-how-to-get-circle-from-non-square-image
I see that this post is a little out of date but still... I can show you and everyone else (who is in the same situation as I was this day) how i did it.
First of all, you need html like this:
<div class="circle-avatar" style="background-image:url(http://placekitten.com/g/200/400)"></div>
Than your css class will look like this:
div.circle-avatar{
/* make it responsive */
max-width: 100%;
width:100%;
height:auto;
display:block;
/* div height to be the same as width*/
padding-top:100%;
/* make it a cirkle */
border-radius:50%;
/* Centering on image`s center*/
background-position-y: center;
background-position-x: center;
background-repeat: no-repeat;
/* it makes the clue thing, takes smaller dimention to fill div */
background-size: cover;
/* it is optional, for making this div centered in parent*/
margin: 0 auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
Langganan:
Postingan (Atom)
