Saturday, December 8, 2012

style.captionSide

Properti style.captionSide digunakan untuk menetapkan posisi elemen CAPTION di dalam elemen TABLE.

Sintaks:

obj.style.captionSide = value;

Nilainya:

  • top (default)
    Posisi CAPTION di atas TABLE.
  • bottom
    Posisi CAPTION di bawah TABLE.
  • left
    Posisi CAPTION di kiri TABLE.
  • right
    Posisi CAPTION di kanan TABLE.
  • inherit

Contoh di bawah ini memposisikan CAPTION di bawah TABLE setelah tombol di klik:

<HTML> <HEAD> <TITLE>style.captionSide</TITLE> <SCRIPT TYPE="text/javascript"> function SetCaptionSide() { var tableElem = document.getElementById("mytable"); tableElem.style.captionSide = "bottom"; } </SCRIPT> </HEAD> <BODY> <TABLE ID="mytable" BORDER="1"> <CAPTION>Halo saya Caption Box!</CAPTION> <TR> <TD>row 1, cell 1</TD> </TR> <TR> <TD>row 2, cell 1</TD> </TR> </TABLE> <BUTTON TYPE="button" ONCLICK="SetCaptionSide()">Set captionSide='bottom'.</BUTTON> </BODY> </HTML>