HtmlTable.CellSpacing プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As HtmlTable Dim value As Integer value = instance.CellSpacing instance.CellSpacing = value
/** @property */ public int get_CellSpacing () /** @property */ public void set_CellSpacing (int value)
HtmlTable コントロール内の隣接するセル間の間隔 (ピクセル単位)。既定値は -1 です。このプロパティが設定されていないことを示します。


CellSpacing プロパティを使用して、HtmlTable コントロール内のセルの間隔をプログラムで制御する方法を次のコード例に示します。
<%@ Page Language="VB" AutoEventWireup="True" %> <script runat="server"> Sub Button_Click(ByVal sender As Object, ByVal e As EventArgs) ' Set the HtmlTable properties according to the ' user selections. Table1.CellSpacing = CInt(SpacingSelect.Value) Table1.CellPadding = CInt(PaddingSelect.Value) Table1.Align = AlignSelect.Value End Sub </script> <html> <head> <title>HtmlTable Example</title> </head> <body> <form runat="server"> <h3>HtmlTable Example</h3> <table id="Table1" Border="1" BorderColor="black" runat="server"> <tr> <th> Column 1 </th> <th> Column 2 </th> <th> Column 3 </th> </tr> <tr> <td> Cell 1 </td> <td> Cell 2 </td> <td> Cell 3 </td> </tr> <tr> <td> Cell 4 </td> <td> Cell 5 </td> <td> Cell 6 </td> </tr> </table> <br><br><br><br><br><br><br><br> <hr> Select the display settings: <br><br> Align: <select id="AlignSelect" runat="server"> <option Value="Left">Left</option> <option Value="Center">Center</option> <option Value="Right">Right</option> </select> CellPadding: <select id="PaddingSelect" runat="server"> <option Value="0">0</option> <option Value="1">1</option> <option Value="2">2</option> <option Value="3">3</option> <option Value="4">4</option> <option Value="5">5</option> </select> CellSpacing: <select id="SpacingSelect" runat="server"> <option Value="0">0</option> <option Value="1">1</option> <option Value="2">2</option> <option Value="3">3</option> <option Value="4">4</option> <option Value="5">5</option> </select> <br><br> <input type="button" value="Generate Table" OnServerClick ="Button_Click" runat="server"/> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <script runat="server"> void Button_Click(Object sender, EventArgs e) { // Set the HtmlTable properties according to the // user selections. Table1.CellSpacing = Convert.ToInt32(SpacingSelect.Value); Table1.CellPadding = Convert.ToInt32(PaddingSelect.Value); Table1.Align = AlignSelect.Value; } </script> <html> <head> <title>HtmlTable Example</title> </head> <body> <form runat="server"> <h3>HtmlTable Example</h3> <table id="Table1" Border="1" BorderColor="black" runat="server"> <tr> <th> Column 1 </th> <th> Column 2 </th> <th> Column 3 </th> </tr> <tr> <td> Cell 1 </td> <td> Cell 2 </td> <td> Cell 3 </td> </tr> <tr> <td> Cell 4 </td> <td> Cell 5 </td> <td> Cell 6 </td> </tr> </table> <br><br><br><br><br><br><br><br> <hr> Select the display settings: <br><br> Align: <select id="AlignSelect" runat="server"> <option Value="Left">Left</option> <option Value="Center">Center</option> <option Value="Right">Right</option> </select> CellPadding: <select id="PaddingSelect" runat="server"> <option Value="0">0</option> <option Value="1">1</option> <option Value="2">2</option> <option Value="3">3</option> <option Value="4">4</option> <option Value="5">5</option> </select> CellSpacing: <select id="SpacingSelect" runat="server"> <option Value="0">0</option> <option Value="1">1</option> <option Value="2">2</option> <option Value="3">3</option> <option Value="4">4</option> <option Value="5">5</option> </select> <br><br> <input type="button" value="Generate Table" OnServerClick ="Button_Click" runat="server"/> </form> </body> </html>
<%@ Page Language="JScript" AutoEventWireup="True" %> <script runat="server"> function Button_Click(sender : Object, e : EventArgs) { // Set the HtmlTable properties according to the // user selections. Table1.CellSpacing = Convert.ToInt32(SpacingSelect.Value); Table1.CellPadding = Convert.ToInt32(PaddingSelect.Value); Table1.Align = AlignSelect.Value; } </script> <html> <head> <title>HtmlTable Example</title> </head> <body> <form runat="server"> <h3>HtmlTable Example</h3> <table id="Table1" Border="1" BorderColor="black" runat="server"> <tr> <th> Column 1 </th> <th> Column 2 </th> <th> Column 3 </th> </tr> <tr> <td> Cell 1 </td> <td> Cell 2 </td> <td> Cell 3 </td> </tr> <tr> <td> Cell 4 </td> <td> Cell 5 </td> <td> Cell 6 </td> </tr> </table> <br><br><br><br><br><br><br><br> <hr> Select the display settings: <br><br> Align: <select id="AlignSelect" runat="server"> <option Value="Left">Left</option> <option Value="Center">Center</option> <option Value="Right">Right</option> </select> CellPadding: <select id="PaddingSelect" runat="server"> <option Value="0">0</option> <option Value="1">1</option> <option Value="2">2</option> <option Value="3">3</option> <option Value="4">4</option> <option Value="5">5</option> </select> CellSpacing: <select id="SpacingSelect" runat="server"> <option Value="0">0</option> <option Value="1">1</option> <option Value="2">2</option> <option Value="3">3</option> <option Value="4">4</option> <option Value="5">5</option> </select> <br><br> <input type="button" value="Generate Table" OnServerClick ="Button_Click" runat="server"/> </form> </body> </html>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からHtmlTable.CellSpacing プロパティを検索する場合は、下記のリンクをクリックしてください。

- HtmlTable.CellSpacing プロパティのページへのリンク