WPF Table is my custom control for simulating the table element of the web/html.

Code Example:

<Sunny:Table Margin="10" CellPadding="10">
    <Sunny:Table.Rows>
        <Sunny:TableRow>
            <Sunny:TableRow.Cells>
                <Sunny:TableCell><TextBlock>11</TextBlock></Sunny:TableCell>
                <Sunny:TableCell><TextBlock>12</TextBlock></Sunny:TableCell>
                <Sunny:TableCell><TextBlock>13</TextBlock></Sunny:TableCell>
                <Sunny:TableCell><TextBlock>14</TextBlock></Sunny:TableCell>
            </Sunny:TableRow.Cells>
        </Sunny:TableRow>
        <Sunny:TableRow>
            <Sunny:TableRow.Cells>
                <Sunny:TableCell><TextBlock>1</TextBlock></Sunny:TableCell>
                <Sunny:TableCell RowSpan="2" ColumnSpan="2"><TextBlock>2</TextBlock></Sunny:TableCell>
                <Sunny:TableCell><TextBlock>3</TextBlock></Sunny:TableCell>
            </Sunny:TableRow.Cells>
        </Sunny:TableRow>
        <Sunny:TableRow>
            <Sunny:TableRow.Cells>
                <Sunny:TableCell><TextBlock>4</TextBlock></Sunny:TableCell>
                <Sunny:TableCell><TextBlock>5</TextBlock></Sunny:TableCell>
            </Sunny:TableRow.Cells>
        </Sunny:TableRow>
        <Sunny:TableRow>
            <Sunny:TableRow.Cells>
                <Sunny:TableCell><TextBlock>7</TextBlock></Sunny:TableCell>
                <Sunny:TableCell><TextBlock>8</TextBlock></Sunny:TableCell>
                <Sunny:TableCell><TextBlock>9</TextBlock></Sunny:TableCell>
                <Sunny:TableCell><TextBlock>10</TextBlock></Sunny:TableCell>
            </Sunny:TableRow.Cells>
        </Sunny:TableRow>
    </Sunny:Table.Rows>
</Sunny:Table>

The UI of the code above:

 

The control only meet the requirement for my project currently. Many functions needs to be improved and appended.Suggestions will be heartily appreciated.

if you are interested in my project and willing to donate to me. you may click the link below to open the PayPal to pay.

 

WPF Table 我自己写的是一个模拟web/html上的table元素的自定义控件。

示例代码:

<Sunny:Table Margin="10" CellPadding="10">
    <Sunny:Table.Rows>
        <Sunny:TableRow>
            <Sunny:TableRow.Cells>
                <Sunny:TableCell><TextBlock>11</TextBlock></Sunny:TableCell>
                <Sunny:TableCell><TextBlock>12</TextBlock></Sunny:TableCell>
                <Sunny:TableCell><TextBlock>13</TextBlock></Sunny:TableCell>
                <Sunny:TableCell><TextBlock>14</TextBlock></Sunny:TableCell>
            </Sunny:TableRow.Cells>
        </Sunny:TableRow>
        <Sunny:TableRow>
            <Sunny:TableRow.Cells>
                <Sunny:TableCell><TextBlock>1</TextBlock></Sunny:TableCell>
                <Sunny:TableCell RowSpan="2" ColumnSpan="2"><TextBlock>2</TextBlock></Sunny:TableCell>
                <Sunny:TableCell><TextBlock>3</TextBlock></Sunny:TableCell>
            </Sunny:TableRow.Cells>
        </Sunny:TableRow>
        <Sunny:TableRow>
            <Sunny:TableRow.Cells>
                <Sunny:TableCell><TextBlock>4</TextBlock></Sunny:TableCell>
                <Sunny:TableCell><TextBlock>5</TextBlock></Sunny:TableCell>
            </Sunny:TableRow.Cells>
        </Sunny:TableRow>
        <Sunny:TableRow>
            <Sunny:TableRow.Cells>
                <Sunny:TableCell><TextBlock>7</TextBlock></Sunny:TableCell>
                <Sunny:TableCell><TextBlock>8</TextBlock></Sunny:TableCell>
                <Sunny:TableCell><TextBlock>9</TextBlock></Sunny:TableCell>
                <Sunny:TableCell><TextBlock>10</TextBlock></Sunny:TableCell>
            </Sunny:TableRow.Cells>
        </Sunny:TableRow>
    </Sunny:Table.Rows>
</Sunny:Table>

以上代码生成的界面:

这个控件只能满足我自己现阶段的项目需要,还有很多地方需要改进,欢迎提出建议。

如果你对本项目感兴趣,并希望资助其发展,欢迎捐助。我的支付宝账号是:livemylive@msn.com

或者扫描以下二维码: